Lines Matching refs:tfm
94 static int setkey_fallback_cip(struct crypto_tfm *tfm, const u8 *in_key, in setkey_fallback_cip() argument
97 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in setkey_fallback_cip()
101 sctx->fallback.cip->base.crt_flags |= (tfm->crt_flags & in setkey_fallback_cip()
106 tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK; in setkey_fallback_cip()
107 tfm->crt_flags |= (sctx->fallback.cip->base.crt_flags & in setkey_fallback_cip()
113 static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, in aes_set_key() argument
116 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in aes_set_key()
117 u32 *flags = &tfm->crt_flags; in aes_set_key()
132 return setkey_fallback_cip(tfm, in_key, key_len); in aes_set_key()
135 static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) in aes_encrypt() argument
137 const struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in aes_encrypt()
160 static void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) in aes_decrypt() argument
162 const struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in aes_decrypt()
185 static int fallback_init_cip(struct crypto_tfm *tfm) in fallback_init_cip() argument
187 const char *name = tfm->__crt_alg->cra_name; in fallback_init_cip()
188 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in fallback_init_cip()
202 static void fallback_exit_cip(struct crypto_tfm *tfm) in fallback_exit_cip() argument
204 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in fallback_exit_cip()
232 static int setkey_fallback_blk(struct crypto_tfm *tfm, const u8 *key, in setkey_fallback_blk() argument
235 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in setkey_fallback_blk()
239 sctx->fallback.blk->base.crt_flags |= (tfm->crt_flags & in setkey_fallback_blk()
244 tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK; in setkey_fallback_blk()
245 tfm->crt_flags |= (sctx->fallback.blk->base.crt_flags & in setkey_fallback_blk()
256 struct crypto_blkcipher *tfm; in fallback_blk_dec() local
257 struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); in fallback_blk_dec()
259 tfm = desc->tfm; in fallback_blk_dec()
260 desc->tfm = sctx->fallback.blk; in fallback_blk_dec()
264 desc->tfm = tfm; in fallback_blk_dec()
273 struct crypto_blkcipher *tfm; in fallback_blk_enc() local
274 struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); in fallback_blk_enc()
276 tfm = desc->tfm; in fallback_blk_enc()
277 desc->tfm = sctx->fallback.blk; in fallback_blk_enc()
281 desc->tfm = tfm; in fallback_blk_enc()
285 static int ecb_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, in ecb_aes_set_key() argument
288 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in ecb_aes_set_key()
294 return setkey_fallback_blk(tfm, in_key, key_len); in ecb_aes_set_key()
312 return aes_set_key(tfm, in_key, key_len); in ecb_aes_set_key()
342 struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); in ecb_aes_encrypt()
356 struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); in ecb_aes_decrypt()
366 static int fallback_init_blk(struct crypto_tfm *tfm) in fallback_init_blk() argument
368 const char *name = tfm->__crt_alg->cra_name; in fallback_init_blk()
369 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in fallback_init_blk()
383 static void fallback_exit_blk(struct crypto_tfm *tfm) in fallback_exit_blk() argument
385 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in fallback_exit_blk()
414 static int cbc_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, in cbc_aes_set_key() argument
417 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in cbc_aes_set_key()
423 return setkey_fallback_blk(tfm, in_key, key_len); in cbc_aes_set_key()
441 return aes_set_key(tfm, in_key, key_len); in cbc_aes_set_key()
447 struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); in cbc_aes_crypt()
483 struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); in cbc_aes_encrypt()
497 struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); in cbc_aes_decrypt()
531 static int xts_fallback_setkey(struct crypto_tfm *tfm, const u8 *key, in xts_fallback_setkey() argument
534 struct s390_xts_ctx *xts_ctx = crypto_tfm_ctx(tfm); in xts_fallback_setkey()
538 xts_ctx->fallback->base.crt_flags |= (tfm->crt_flags & in xts_fallback_setkey()
543 tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK; in xts_fallback_setkey()
544 tfm->crt_flags |= (xts_ctx->fallback->base.crt_flags & in xts_fallback_setkey()
554 struct s390_xts_ctx *xts_ctx = crypto_blkcipher_ctx(desc->tfm); in xts_fallback_decrypt()
555 struct crypto_blkcipher *tfm; in xts_fallback_decrypt() local
558 tfm = desc->tfm; in xts_fallback_decrypt()
559 desc->tfm = xts_ctx->fallback; in xts_fallback_decrypt()
563 desc->tfm = tfm; in xts_fallback_decrypt()
571 struct s390_xts_ctx *xts_ctx = crypto_blkcipher_ctx(desc->tfm); in xts_fallback_encrypt()
572 struct crypto_blkcipher *tfm; in xts_fallback_encrypt() local
575 tfm = desc->tfm; in xts_fallback_encrypt()
576 desc->tfm = xts_ctx->fallback; in xts_fallback_encrypt()
580 desc->tfm = tfm; in xts_fallback_encrypt()
584 static int xts_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, in xts_aes_set_key() argument
587 struct s390_xts_ctx *xts_ctx = crypto_tfm_ctx(tfm); in xts_aes_set_key()
588 u32 *flags = &tfm->crt_flags; in xts_aes_set_key()
600 xts_fallback_setkey(tfm, in_key, key_len); in xts_aes_set_key()
666 struct s390_xts_ctx *xts_ctx = crypto_blkcipher_ctx(desc->tfm); in xts_aes_encrypt()
680 struct s390_xts_ctx *xts_ctx = crypto_blkcipher_ctx(desc->tfm); in xts_aes_decrypt()
690 static int xts_fallback_init(struct crypto_tfm *tfm) in xts_fallback_init() argument
692 const char *name = tfm->__crt_alg->cra_name; in xts_fallback_init()
693 struct s390_xts_ctx *xts_ctx = crypto_tfm_ctx(tfm); in xts_fallback_init()
706 static void xts_fallback_exit(struct crypto_tfm *tfm) in xts_fallback_exit() argument
708 struct s390_xts_ctx *xts_ctx = crypto_tfm_ctx(tfm); in xts_fallback_exit()
740 static int ctr_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, in ctr_aes_set_key() argument
743 struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); in ctr_aes_set_key()
760 return aes_set_key(tfm, in_key, key_len); in ctr_aes_set_key()
850 struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); in ctr_aes_encrypt()
861 struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); in ctr_aes_decrypt()