Lines Matching refs:tfm

95 static int setkey_fallback_cip(struct crypto_tfm *tfm, const u8 *in_key,  in setkey_fallback_cip()  argument
98 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in setkey_fallback_cip()
102 sctx->fallback.cip->base.crt_flags |= (tfm->crt_flags & in setkey_fallback_cip()
107 tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK; in setkey_fallback_cip()
108 tfm->crt_flags |= (sctx->fallback.cip->base.crt_flags & in setkey_fallback_cip()
114 static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, in aes_set_key() argument
117 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in aes_set_key()
118 u32 *flags = &tfm->crt_flags; in aes_set_key()
133 return setkey_fallback_cip(tfm, in_key, key_len); in aes_set_key()
136 static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) in aes_encrypt() argument
138 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in aes_encrypt()
161 static void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) in aes_decrypt() argument
163 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in aes_decrypt()
186 static int fallback_init_cip(struct crypto_tfm *tfm) in fallback_init_cip() argument
188 const char *name = tfm->__crt_alg->cra_name; in fallback_init_cip()
189 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in fallback_init_cip()
203 static void fallback_exit_cip(struct crypto_tfm *tfm) in fallback_exit_cip() argument
205 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in fallback_exit_cip()
233 static int setkey_fallback_blk(struct crypto_tfm *tfm, const u8 *key, in setkey_fallback_blk() argument
236 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in setkey_fallback_blk()
240 sctx->fallback.blk->base.crt_flags |= (tfm->crt_flags & in setkey_fallback_blk()
245 tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK; in setkey_fallback_blk()
246 tfm->crt_flags |= (sctx->fallback.blk->base.crt_flags & in setkey_fallback_blk()
257 struct crypto_blkcipher *tfm; in fallback_blk_dec() local
258 struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); in fallback_blk_dec()
260 tfm = desc->tfm; in fallback_blk_dec()
261 desc->tfm = sctx->fallback.blk; in fallback_blk_dec()
265 desc->tfm = tfm; in fallback_blk_dec()
274 struct crypto_blkcipher *tfm; in fallback_blk_enc() local
275 struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); in fallback_blk_enc()
277 tfm = desc->tfm; in fallback_blk_enc()
278 desc->tfm = sctx->fallback.blk; in fallback_blk_enc()
282 desc->tfm = tfm; in fallback_blk_enc()
286 static int ecb_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, in ecb_aes_set_key() argument
289 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in ecb_aes_set_key()
295 return setkey_fallback_blk(tfm, in_key, key_len); in ecb_aes_set_key()
313 return aes_set_key(tfm, in_key, key_len); in ecb_aes_set_key()
343 struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); in ecb_aes_encrypt()
357 struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); in ecb_aes_decrypt()
367 static int fallback_init_blk(struct crypto_tfm *tfm) in fallback_init_blk() argument
369 const char *name = tfm->__crt_alg->cra_name; in fallback_init_blk()
370 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in fallback_init_blk()
384 static void fallback_exit_blk(struct crypto_tfm *tfm) in fallback_exit_blk() argument
386 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in fallback_exit_blk()
415 static int cbc_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, in cbc_aes_set_key() argument
418 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in cbc_aes_set_key()
424 return setkey_fallback_blk(tfm, in_key, key_len); in cbc_aes_set_key()
442 return aes_set_key(tfm, in_key, key_len); in cbc_aes_set_key()
448 struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); in cbc_aes_crypt()
484 struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); in cbc_aes_encrypt()
498 struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); in cbc_aes_decrypt()
532 static int xts_fallback_setkey(struct crypto_tfm *tfm, const u8 *key, in xts_fallback_setkey() argument
535 struct s390_xts_ctx *xts_ctx = crypto_tfm_ctx(tfm); in xts_fallback_setkey()
539 xts_ctx->fallback->base.crt_flags |= (tfm->crt_flags & in xts_fallback_setkey()
544 tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK; in xts_fallback_setkey()
545 tfm->crt_flags |= (xts_ctx->fallback->base.crt_flags & in xts_fallback_setkey()
555 struct s390_xts_ctx *xts_ctx = crypto_blkcipher_ctx(desc->tfm); in xts_fallback_decrypt()
556 struct crypto_blkcipher *tfm; in xts_fallback_decrypt() local
559 tfm = desc->tfm; in xts_fallback_decrypt()
560 desc->tfm = xts_ctx->fallback; in xts_fallback_decrypt()
564 desc->tfm = tfm; in xts_fallback_decrypt()
572 struct s390_xts_ctx *xts_ctx = crypto_blkcipher_ctx(desc->tfm); in xts_fallback_encrypt()
573 struct crypto_blkcipher *tfm; in xts_fallback_encrypt() local
576 tfm = desc->tfm; in xts_fallback_encrypt()
577 desc->tfm = xts_ctx->fallback; in xts_fallback_encrypt()
581 desc->tfm = tfm; in xts_fallback_encrypt()
585 static int xts_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, in xts_aes_set_key() argument
588 struct s390_xts_ctx *xts_ctx = crypto_tfm_ctx(tfm); in xts_aes_set_key()
589 u32 *flags = &tfm->crt_flags; in xts_aes_set_key()
601 xts_fallback_setkey(tfm, in_key, key_len); in xts_aes_set_key()
667 struct s390_xts_ctx *xts_ctx = crypto_blkcipher_ctx(desc->tfm); in xts_aes_encrypt()
681 struct s390_xts_ctx *xts_ctx = crypto_blkcipher_ctx(desc->tfm); in xts_aes_decrypt()
691 static int xts_fallback_init(struct crypto_tfm *tfm) in xts_fallback_init() argument
693 const char *name = tfm->__crt_alg->cra_name; in xts_fallback_init()
694 struct s390_xts_ctx *xts_ctx = crypto_tfm_ctx(tfm); in xts_fallback_init()
707 static void xts_fallback_exit(struct crypto_tfm *tfm) in xts_fallback_exit() argument
709 struct s390_xts_ctx *xts_ctx = crypto_tfm_ctx(tfm); in xts_fallback_exit()
741 static int ctr_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, in ctr_aes_set_key() argument
744 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in ctr_aes_set_key()
761 return aes_set_key(tfm, in_key, key_len); in ctr_aes_set_key()
851 struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); in ctr_aes_encrypt()
862 struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); in ctr_aes_decrypt()