• Home
  • Raw
  • Download

Lines Matching refs:sctx

75 	struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm);  in setkey_fallback_cip()  local
77 sctx->fallback.cip->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK; in setkey_fallback_cip()
78 sctx->fallback.cip->base.crt_flags |= (tfm->crt_flags & in setkey_fallback_cip()
81 return crypto_cipher_setkey(sctx->fallback.cip, in_key, key_len); in setkey_fallback_cip()
87 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in aes_set_key() local
96 sctx->fc = (fc && cpacf_test_func(&km_functions, fc)) ? fc : 0; in aes_set_key()
97 if (!sctx->fc) in aes_set_key()
100 sctx->key_len = key_len; in aes_set_key()
101 memcpy(sctx->key, in_key, key_len); in aes_set_key()
107 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in crypto_aes_encrypt() local
109 if (unlikely(!sctx->fc)) { in crypto_aes_encrypt()
110 crypto_cipher_encrypt_one(sctx->fallback.cip, out, in); in crypto_aes_encrypt()
113 cpacf_km(sctx->fc, &sctx->key, out, in, AES_BLOCK_SIZE); in crypto_aes_encrypt()
118 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in crypto_aes_decrypt() local
120 if (unlikely(!sctx->fc)) { in crypto_aes_decrypt()
121 crypto_cipher_decrypt_one(sctx->fallback.cip, out, in); in crypto_aes_decrypt()
124 cpacf_km(sctx->fc | CPACF_DECRYPT, in crypto_aes_decrypt()
125 &sctx->key, out, in, AES_BLOCK_SIZE); in crypto_aes_decrypt()
131 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in fallback_init_cip() local
133 sctx->fallback.cip = crypto_alloc_cipher(name, 0, in fallback_init_cip()
136 if (IS_ERR(sctx->fallback.cip)) { in fallback_init_cip()
139 return PTR_ERR(sctx->fallback.cip); in fallback_init_cip()
147 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in fallback_exit_cip() local
149 crypto_free_cipher(sctx->fallback.cip); in fallback_exit_cip()
150 sctx->fallback.cip = NULL; in fallback_exit_cip()
178 struct s390_aes_ctx *sctx = crypto_skcipher_ctx(tfm); in setkey_fallback_skcipher() local
180 crypto_skcipher_clear_flags(sctx->fallback.skcipher, in setkey_fallback_skcipher()
182 crypto_skcipher_set_flags(sctx->fallback.skcipher, in setkey_fallback_skcipher()
185 return crypto_skcipher_setkey(sctx->fallback.skcipher, key, len); in setkey_fallback_skcipher()
188 static int fallback_skcipher_crypt(struct s390_aes_ctx *sctx, in fallback_skcipher_crypt() argument
195 skcipher_request_set_tfm(subreq, sctx->fallback.skcipher); in fallback_skcipher_crypt()
204 struct s390_aes_ctx *sctx = crypto_skcipher_ctx(tfm); in ecb_aes_set_key() local
213 sctx->fc = (fc && cpacf_test_func(&km_functions, fc)) ? fc : 0; in ecb_aes_set_key()
214 if (!sctx->fc) in ecb_aes_set_key()
217 sctx->key_len = key_len; in ecb_aes_set_key()
218 memcpy(sctx->key, in_key, key_len); in ecb_aes_set_key()
225 struct s390_aes_ctx *sctx = crypto_skcipher_ctx(tfm); in ecb_aes_crypt() local
230 if (unlikely(!sctx->fc)) in ecb_aes_crypt()
231 return fallback_skcipher_crypt(sctx, req, modifier); in ecb_aes_crypt()
237 cpacf_km(sctx->fc | modifier, sctx->key, in ecb_aes_crypt()
257 struct s390_aes_ctx *sctx = crypto_skcipher_ctx(tfm); in fallback_init_skcipher() local
259 sctx->fallback.skcipher = crypto_alloc_skcipher(name, 0, in fallback_init_skcipher()
262 if (IS_ERR(sctx->fallback.skcipher)) { in fallback_init_skcipher()
265 return PTR_ERR(sctx->fallback.skcipher); in fallback_init_skcipher()
269 crypto_skcipher_reqsize(sctx->fallback.skcipher)); in fallback_init_skcipher()
275 struct s390_aes_ctx *sctx = crypto_skcipher_ctx(tfm); in fallback_exit_skcipher() local
277 crypto_free_skcipher(sctx->fallback.skcipher); in fallback_exit_skcipher()
300 struct s390_aes_ctx *sctx = crypto_skcipher_ctx(tfm); in cbc_aes_set_key() local
309 sctx->fc = (fc && cpacf_test_func(&kmc_functions, fc)) ? fc : 0; in cbc_aes_set_key()
310 if (!sctx->fc) in cbc_aes_set_key()
313 sctx->key_len = key_len; in cbc_aes_set_key()
314 memcpy(sctx->key, in_key, key_len); in cbc_aes_set_key()
321 struct s390_aes_ctx *sctx = crypto_skcipher_ctx(tfm); in cbc_aes_crypt() local
330 if (unlikely(!sctx->fc)) in cbc_aes_crypt()
331 return fallback_skcipher_crypt(sctx, req, modifier); in cbc_aes_crypt()
337 memcpy(param.key, sctx->key, sctx->key_len); in cbc_aes_crypt()
341 cpacf_kmc(sctx->fc | modifier, &param, in cbc_aes_crypt()
536 struct s390_aes_ctx *sctx = crypto_skcipher_ctx(tfm); in ctr_aes_set_key() local
545 sctx->fc = (fc && cpacf_test_func(&kmctr_functions, fc)) ? fc : 0; in ctr_aes_set_key()
546 if (!sctx->fc) in ctr_aes_set_key()
549 sctx->key_len = key_len; in ctr_aes_set_key()
550 memcpy(sctx->key, in_key, key_len); in ctr_aes_set_key()
572 struct s390_aes_ctx *sctx = crypto_skcipher_ctx(tfm); in ctr_aes_crypt() local
578 if (unlikely(!sctx->fc)) in ctr_aes_crypt()
579 return fallback_skcipher_crypt(sctx, req, 0); in ctr_aes_crypt()
590 cpacf_kmctr(sctx->fc, sctx->key, walk.dst.virt.addr, in ctr_aes_crypt()
606 cpacf_kmctr(sctx->fc, sctx->key, buf, buf, in ctr_aes_crypt()