Lines Matching refs:tfm
147 struct crypto_tfm *tfm; member
235 static inline u32 cipher_cfg_enc(struct crypto_tfm *tfm) in cipher_cfg_enc() argument
237 return container_of(tfm->__crt_alg, struct ixp_alg,crypto)->cfg_enc; in cipher_cfg_enc()
240 static inline u32 cipher_cfg_dec(struct crypto_tfm *tfm) in cipher_cfg_dec() argument
242 return container_of(tfm->__crt_alg, struct ixp_alg,crypto)->cfg_dec; in cipher_cfg_dec()
245 static inline const struct ix_hash_algo *ix_hash(struct crypto_tfm *tfm) in ix_hash() argument
247 return container_of(tfm->__crt_alg, struct ixp_alg, crypto)->hash; in ix_hash()
340 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in finish_scattered_hmac() local
341 int authsize = crypto_aead_authsize(tfm); in finish_scattered_hmac()
386 ctx = crypto_tfm_ctx(crypt->data.tfm); in one_packet()
394 ctx = crypto_tfm_ctx(crypt->data.tfm); in one_packet()
554 static int init_tfm(struct crypto_tfm *tfm) in init_tfm() argument
556 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm); in init_tfm()
570 static int init_tfm_ablk(struct crypto_tfm *tfm) in init_tfm_ablk() argument
572 tfm->crt_ablkcipher.reqsize = sizeof(struct ablk_ctx); in init_tfm_ablk()
573 return init_tfm(tfm); in init_tfm_ablk()
576 static int init_tfm_aead(struct crypto_tfm *tfm) in init_tfm_aead() argument
578 tfm->crt_aead.reqsize = sizeof(struct aead_ctx); in init_tfm_aead()
579 return init_tfm(tfm); in init_tfm_aead()
582 static void exit_tfm(struct crypto_tfm *tfm) in exit_tfm() argument
584 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm); in exit_tfm()
589 static int register_chain_var(struct crypto_tfm *tfm, u8 xpad, u32 target, in register_chain_var() argument
592 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm); in register_chain_var()
621 crypt->data.tfm = tfm; in register_chain_var()
645 static int setup_auth(struct crypto_tfm *tfm, int encrypt, unsigned authsize, in setup_auth() argument
653 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm); in setup_auth()
658 algo = ix_hash(tfm); in setup_auth()
684 ret = register_chain_var(tfm, HMAC_OPAD_VALUE, otarget, in setup_auth()
688 return register_chain_var(tfm, HMAC_IPAD_VALUE, itarget, in setup_auth()
692 static int gen_rev_aes_key(struct crypto_tfm *tfm) in gen_rev_aes_key() argument
695 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm); in gen_rev_aes_key()
704 crypt->data.tfm = tfm; in gen_rev_aes_key()
720 static int setup_cipher(struct crypto_tfm *tfm, int encrypt, in setup_cipher() argument
727 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm); in setup_cipher()
728 u32 *flags = &tfm->crt_flags; in setup_cipher()
734 cipher_cfg = cipher_cfg_enc(tfm); in setup_cipher()
737 cipher_cfg = cipher_cfg_dec(tfm); in setup_cipher()
777 return gen_rev_aes_key(tfm); in setup_cipher()
814 static int ablk_setkey(struct crypto_ablkcipher *tfm, const u8 *key, in ablk_setkey() argument
817 struct ixp_ctx *ctx = crypto_ablkcipher_ctx(tfm); in ablk_setkey()
818 u32 *flags = &tfm->base.crt_flags; in ablk_setkey()
830 ret = setup_cipher(&tfm->base, 0, key, key_len); in ablk_setkey()
833 ret = setup_cipher(&tfm->base, 1, key, key_len); in ablk_setkey()
850 static int ablk_rfc3686_setkey(struct crypto_ablkcipher *tfm, const u8 *key, in ablk_rfc3686_setkey() argument
853 struct ixp_ctx *ctx = crypto_ablkcipher_ctx(tfm); in ablk_rfc3686_setkey()
863 return ablk_setkey(tfm, key, key_len); in ablk_rfc3686_setkey()
868 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); in ablk_perform() local
869 struct ixp_ctx *ctx = crypto_ablkcipher_ctx(tfm); in ablk_perform()
870 unsigned ivsize = crypto_ablkcipher_ivsize(tfm); in ablk_perform()
951 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); in ablk_rfc3686_crypt() local
952 struct ixp_ctx *ctx = crypto_ablkcipher_ctx(tfm); in ablk_rfc3686_crypt()
992 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in aead_perform() local
993 struct ixp_ctx *ctx = crypto_aead_ctx(tfm); in aead_perform()
994 unsigned ivsize = crypto_aead_ivsize(tfm); in aead_perform()
995 unsigned authsize = crypto_aead_authsize(tfm); in aead_perform()
1094 static int aead_setup(struct crypto_aead *tfm, unsigned int authsize) in aead_setup() argument
1096 struct ixp_ctx *ctx = crypto_aead_ctx(tfm); in aead_setup()
1097 u32 *flags = &tfm->base.crt_flags; in aead_setup()
1098 unsigned digest_len = crypto_aead_alg(tfm)->maxauthsize; in aead_setup()
1109 ret = setup_cipher(&tfm->base, 0, ctx->enckey, ctx->enckey_len); in aead_setup()
1112 ret = setup_cipher(&tfm->base, 1, ctx->enckey, ctx->enckey_len); in aead_setup()
1115 ret = setup_auth(&tfm->base, 0, authsize, ctx->authkey, in aead_setup()
1119 ret = setup_auth(&tfm->base, 1, authsize, ctx->authkey, in aead_setup()
1138 static int aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in aead_setauthsize() argument
1140 int max = crypto_aead_alg(tfm)->maxauthsize >> 2; in aead_setauthsize()
1144 return aead_setup(tfm, authsize); in aead_setauthsize()
1147 static int aead_setkey(struct crypto_aead *tfm, const u8 *key, in aead_setkey() argument
1150 struct ixp_ctx *ctx = crypto_aead_ctx(tfm); in aead_setkey()
1167 return aead_setup(tfm, crypto_aead_authsize(tfm)); in aead_setkey()
1169 crypto_aead_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); in aead_setkey()
1189 struct crypto_aead *tfm = aead_givcrypt_reqtfm(req); in aead_givencrypt() local
1190 struct ixp_ctx *ctx = crypto_aead_ctx(tfm); in aead_givencrypt()
1191 unsigned len, ivsize = crypto_aead_ivsize(tfm); in aead_givencrypt()