Lines Matching refs:tfm

147 		struct crypto_tfm *tfm;  member
245 static inline u32 cipher_cfg_enc(struct crypto_tfm *tfm) in cipher_cfg_enc() argument
247 return container_of(tfm->__crt_alg, struct ixp_alg,crypto)->cfg_enc; in cipher_cfg_enc()
250 static inline u32 cipher_cfg_dec(struct crypto_tfm *tfm) in cipher_cfg_dec() argument
252 return container_of(tfm->__crt_alg, struct ixp_alg,crypto)->cfg_dec; in cipher_cfg_dec()
255 static inline const struct ix_hash_algo *ix_hash(struct crypto_tfm *tfm) in ix_hash() argument
257 return container_of(tfm->__crt_alg, struct ixp_alg, crypto)->hash; in ix_hash()
350 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in finish_scattered_hmac() local
351 int authsize = crypto_aead_authsize(tfm); in finish_scattered_hmac()
397 ctx = crypto_tfm_ctx(crypt->data.tfm); in one_packet()
405 ctx = crypto_tfm_ctx(crypt->data.tfm); in one_packet()
565 static int init_tfm(struct crypto_tfm *tfm) in init_tfm() argument
567 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm); in init_tfm()
581 static int init_tfm_ablk(struct crypto_tfm *tfm) in init_tfm_ablk() argument
583 tfm->crt_ablkcipher.reqsize = sizeof(struct ablk_ctx); in init_tfm_ablk()
584 return init_tfm(tfm); in init_tfm_ablk()
587 static int init_tfm_aead(struct crypto_aead *tfm) in init_tfm_aead() argument
589 crypto_aead_set_reqsize(tfm, sizeof(struct aead_ctx)); in init_tfm_aead()
590 return init_tfm(crypto_aead_tfm(tfm)); in init_tfm_aead()
593 static void exit_tfm(struct crypto_tfm *tfm) in exit_tfm() argument
595 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm); in exit_tfm()
600 static void exit_tfm_aead(struct crypto_aead *tfm) in exit_tfm_aead() argument
602 exit_tfm(crypto_aead_tfm(tfm)); in exit_tfm_aead()
605 static int register_chain_var(struct crypto_tfm *tfm, u8 xpad, u32 target, in register_chain_var() argument
608 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm); in register_chain_var()
637 crypt->data.tfm = tfm; in register_chain_var()
661 static int setup_auth(struct crypto_tfm *tfm, int encrypt, unsigned authsize, in setup_auth() argument
669 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm); in setup_auth()
674 algo = ix_hash(tfm); in setup_auth()
700 ret = register_chain_var(tfm, HMAC_OPAD_VALUE, otarget, in setup_auth()
704 return register_chain_var(tfm, HMAC_IPAD_VALUE, itarget, in setup_auth()
708 static int gen_rev_aes_key(struct crypto_tfm *tfm) in gen_rev_aes_key() argument
711 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm); in gen_rev_aes_key()
720 crypt->data.tfm = tfm; in gen_rev_aes_key()
736 static int setup_cipher(struct crypto_tfm *tfm, int encrypt, in setup_cipher() argument
743 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm); in setup_cipher()
744 u32 *flags = &tfm->crt_flags; in setup_cipher()
750 cipher_cfg = cipher_cfg_enc(tfm); in setup_cipher()
753 cipher_cfg = cipher_cfg_dec(tfm); in setup_cipher()
793 return gen_rev_aes_key(tfm); in setup_cipher()
830 static int ablk_setkey(struct crypto_ablkcipher *tfm, const u8 *key, in ablk_setkey() argument
833 struct ixp_ctx *ctx = crypto_ablkcipher_ctx(tfm); in ablk_setkey()
834 u32 *flags = &tfm->base.crt_flags; in ablk_setkey()
846 ret = setup_cipher(&tfm->base, 0, key, key_len); in ablk_setkey()
849 ret = setup_cipher(&tfm->base, 1, key, key_len); in ablk_setkey()
866 static int ablk_rfc3686_setkey(struct crypto_ablkcipher *tfm, const u8 *key, in ablk_rfc3686_setkey() argument
869 struct ixp_ctx *ctx = crypto_ablkcipher_ctx(tfm); in ablk_rfc3686_setkey()
879 return ablk_setkey(tfm, key, key_len); in ablk_rfc3686_setkey()
884 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); in ablk_perform() local
885 struct ixp_ctx *ctx = crypto_ablkcipher_ctx(tfm); in ablk_perform()
886 unsigned ivsize = crypto_ablkcipher_ivsize(tfm); in ablk_perform()
967 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); in ablk_rfc3686_crypt() local
968 struct ixp_ctx *ctx = crypto_ablkcipher_ctx(tfm); in ablk_rfc3686_crypt()
990 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in aead_perform() local
991 struct ixp_ctx *ctx = crypto_aead_ctx(tfm); in aead_perform()
992 unsigned ivsize = crypto_aead_ivsize(tfm); in aead_perform()
993 unsigned authsize = crypto_aead_authsize(tfm); in aead_perform()
1103 static int aead_setup(struct crypto_aead *tfm, unsigned int authsize) in aead_setup() argument
1105 struct ixp_ctx *ctx = crypto_aead_ctx(tfm); in aead_setup()
1106 u32 *flags = &tfm->base.crt_flags; in aead_setup()
1107 unsigned digest_len = crypto_aead_maxauthsize(tfm); in aead_setup()
1118 ret = setup_cipher(&tfm->base, 0, ctx->enckey, ctx->enckey_len); in aead_setup()
1121 ret = setup_cipher(&tfm->base, 1, ctx->enckey, ctx->enckey_len); in aead_setup()
1124 ret = setup_auth(&tfm->base, 0, authsize, ctx->authkey, in aead_setup()
1128 ret = setup_auth(&tfm->base, 1, authsize, ctx->authkey, in aead_setup()
1147 static int aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in aead_setauthsize() argument
1149 int max = crypto_aead_maxauthsize(tfm) >> 2; in aead_setauthsize()
1153 return aead_setup(tfm, authsize); in aead_setauthsize()
1156 static int aead_setkey(struct crypto_aead *tfm, const u8 *key, in aead_setkey() argument
1159 struct ixp_ctx *ctx = crypto_aead_ctx(tfm); in aead_setkey()
1176 return aead_setup(tfm, crypto_aead_authsize(tfm)); in aead_setkey()
1178 crypto_aead_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); in aead_setkey()