Lines Matching refs:tfm

284 aesni_rfc4106_gcm_ctx *aesni_rfc4106_gcm_ctx_get(struct crypto_aead *tfm)  in aesni_rfc4106_gcm_ctx_get()  argument
289 crypto_tfm_ctx(crypto_aead_tfm(tfm)), AESNI_ALIGN); in aesni_rfc4106_gcm_ctx_get()
303 static int aes_set_key_common(struct crypto_tfm *tfm, void *raw_ctx, in aes_set_key_common() argument
307 u32 *flags = &tfm->crt_flags; in aes_set_key_common()
327 static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, in aes_set_key() argument
330 return aes_set_key_common(tfm, crypto_tfm_ctx(tfm), in_key, key_len); in aes_set_key()
333 static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in aes_encrypt() argument
335 struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm)); in aes_encrypt()
346 static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in aes_decrypt() argument
348 struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm)); in aes_decrypt()
359 static void __aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in __aes_encrypt() argument
361 struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm)); in __aes_encrypt()
366 static void __aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in __aes_decrypt() argument
368 struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm)); in __aes_decrypt()
377 struct crypto_aes_ctx *ctx = aes_ctx(crypto_blkcipher_ctx(desc->tfm)); in ecb_encrypt()
401 struct crypto_aes_ctx *ctx = aes_ctx(crypto_blkcipher_ctx(desc->tfm)); in ecb_decrypt()
425 struct crypto_aes_ctx *ctx = aes_ctx(crypto_blkcipher_ctx(desc->tfm)); in cbc_encrypt()
449 struct crypto_aes_ctx *ctx = aes_ctx(crypto_blkcipher_ctx(desc->tfm)); in cbc_decrypt()
508 struct crypto_aes_ctx *ctx = aes_ctx(crypto_blkcipher_ctx(desc->tfm)); in ctr_crypt()
533 static int ablk_ecb_init(struct crypto_tfm *tfm) in ablk_ecb_init() argument
535 return ablk_init_common(tfm, "__driver-ecb-aes-aesni"); in ablk_ecb_init()
538 static int ablk_cbc_init(struct crypto_tfm *tfm) in ablk_cbc_init() argument
540 return ablk_init_common(tfm, "__driver-cbc-aes-aesni"); in ablk_cbc_init()
544 static int ablk_ctr_init(struct crypto_tfm *tfm) in ablk_ctr_init() argument
546 return ablk_init_common(tfm, "__driver-ctr-aes-aesni"); in ablk_ctr_init()
552 static int ablk_pcbc_init(struct crypto_tfm *tfm) in ablk_pcbc_init() argument
554 return ablk_init_common(tfm, "fpu(pcbc(__driver-aes-aesni))"); in ablk_pcbc_init()
568 static int lrw_aesni_setkey(struct crypto_tfm *tfm, const u8 *key, in lrw_aesni_setkey() argument
571 struct aesni_lrw_ctx *ctx = crypto_tfm_ctx(tfm); in lrw_aesni_setkey()
574 err = aes_set_key_common(tfm, ctx->raw_aes_ctx, key, in lrw_aesni_setkey()
582 static void lrw_aesni_exit_tfm(struct crypto_tfm *tfm) in lrw_aesni_exit_tfm() argument
584 struct aesni_lrw_ctx *ctx = crypto_tfm_ctx(tfm); in lrw_aesni_exit_tfm()
592 struct aesni_lrw_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in lrw_encrypt()
616 struct aesni_lrw_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in lrw_decrypt()
637 static int xts_aesni_setkey(struct crypto_tfm *tfm, const u8 *key, in xts_aesni_setkey() argument
640 struct aesni_xts_ctx *ctx = crypto_tfm_ctx(tfm); in xts_aesni_setkey()
641 u32 *flags = &tfm->crt_flags; in xts_aesni_setkey()
653 err = aes_set_key_common(tfm, ctx->raw_crypt_ctx, key, keylen / 2); in xts_aesni_setkey()
658 return aes_set_key_common(tfm, ctx->raw_tweak_ctx, key + keylen / 2, in xts_aesni_setkey()
719 struct aesni_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in xts_encrypt()
730 struct aesni_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in xts_decrypt()
743 struct aesni_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in xts_encrypt()
768 struct aesni_xts_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); in xts_decrypt()
793 static int rfc4106_init(struct crypto_tfm *tfm) in rfc4106_init() argument
797 PTR_ALIGN((u8 *)crypto_tfm_ctx(tfm), AESNI_ALIGN); in rfc4106_init()
810 tfm->crt_aead.reqsize = sizeof(struct aead_request) in rfc4106_init()
815 static void rfc4106_exit(struct crypto_tfm *tfm) in rfc4106_exit() argument
819 PTR_ALIGN((u8 *)crypto_tfm_ctx(tfm), AESNI_ALIGN); in rfc4106_exit()
899 struct crypto_tfm *tfm = crypto_aead_tfm(aead); in common_rfc4106_set_key() local
904 crypto_tfm_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); in common_rfc4106_set_key()
911 crypto_tfm_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); in common_rfc4106_set_key()
1002 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in __driver_rfc4106_encrypt() local
1003 struct aesni_rfc4106_gcm_ctx *ctx = aesni_rfc4106_gcm_ctx_get(tfm); in __driver_rfc4106_encrypt()
1006 unsigned long auth_tag_len = crypto_aead_authsize(tfm); in __driver_rfc4106_encrypt()
1088 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in __driver_rfc4106_decrypt() local
1089 struct aesni_rfc4106_gcm_ctx *ctx = aesni_rfc4106_gcm_ctx_get(tfm); in __driver_rfc4106_decrypt()
1092 unsigned long auth_tag_len = crypto_aead_authsize(tfm); in __driver_rfc4106_decrypt()
1174 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in rfc4106_encrypt() local
1175 struct aesni_rfc4106_gcm_ctx *ctx = aesni_rfc4106_gcm_ctx_get(tfm); in rfc4106_encrypt()
1195 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in rfc4106_decrypt() local
1196 struct aesni_rfc4106_gcm_ctx *ctx = aesni_rfc4106_gcm_ctx_get(tfm); in rfc4106_decrypt()