Lines Matching defs:tfm

143 		struct crypto_tfm *tfm;
243 static inline u32 cipher_cfg_enc(struct crypto_tfm *tfm)
245 return container_of(tfm->__crt_alg, struct ixp_alg,crypto.base)->cfg_enc;
248 static inline u32 cipher_cfg_dec(struct crypto_tfm *tfm)
250 return container_of(tfm->__crt_alg, struct ixp_alg,crypto.base)->cfg_dec;
253 static inline const struct ix_hash_algo *ix_hash(struct crypto_tfm *tfm)
255 return container_of(tfm->__crt_alg, struct ixp_alg, crypto.base)->hash;
348 struct crypto_aead *tfm = crypto_aead_reqtfm(req);
349 int authsize = crypto_aead_authsize(tfm);
386 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
387 unsigned int ivsize = crypto_skcipher_ivsize(tfm);
409 ctx = crypto_tfm_ctx(crypt->data.tfm);
417 ctx = crypto_tfm_ctx(crypt->data.tfm);
575 static int init_tfm(struct crypto_tfm *tfm)
577 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm);
591 static int init_tfm_ablk(struct crypto_skcipher *tfm)
593 crypto_skcipher_set_reqsize(tfm, sizeof(struct ablk_ctx));
594 return init_tfm(crypto_skcipher_tfm(tfm));
597 static int init_tfm_aead(struct crypto_aead *tfm)
599 crypto_aead_set_reqsize(tfm, sizeof(struct aead_ctx));
600 return init_tfm(crypto_aead_tfm(tfm));
603 static void exit_tfm(struct crypto_tfm *tfm)
605 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm);
610 static void exit_tfm_ablk(struct crypto_skcipher *tfm)
612 exit_tfm(crypto_skcipher_tfm(tfm));
615 static void exit_tfm_aead(struct crypto_aead *tfm)
617 exit_tfm(crypto_aead_tfm(tfm));
620 static int register_chain_var(struct crypto_tfm *tfm, u8 xpad, u32 target,
623 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm);
652 crypt->data.tfm = tfm;
676 static int setup_auth(struct crypto_tfm *tfm, int encrypt, unsigned authsize,
684 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm);
689 algo = ix_hash(tfm);
715 ret = register_chain_var(tfm, HMAC_OPAD_VALUE, otarget,
719 return register_chain_var(tfm, HMAC_IPAD_VALUE, itarget,
723 static int gen_rev_aes_key(struct crypto_tfm *tfm)
726 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm);
735 crypt->data.tfm = tfm;
751 static int setup_cipher(struct crypto_tfm *tfm, int encrypt,
758 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm);
765 cipher_cfg = cipher_cfg_enc(tfm);
768 cipher_cfg = cipher_cfg_dec(tfm);
780 err = crypto_des_verify_key(tfm, key);
798 return gen_rev_aes_key(tfm);
835 static int ablk_setkey(struct crypto_skcipher *tfm, const u8 *key,
838 struct ixp_ctx *ctx = crypto_skcipher_ctx(tfm);
850 ret = setup_cipher(&tfm->base, 0, key, key_len);
853 ret = setup_cipher(&tfm->base, 1, key, key_len);
860 static int ablk_des3_setkey(struct crypto_skcipher *tfm, const u8 *key,
863 return verify_skcipher_des3_key(tfm, key) ?:
864 ablk_setkey(tfm, key, key_len);
867 static int ablk_rfc3686_setkey(struct crypto_skcipher *tfm, const u8 *key,
870 struct ixp_ctx *ctx = crypto_skcipher_ctx(tfm);
880 return ablk_setkey(tfm, key, key_len);
885 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
886 struct ixp_ctx *ctx = crypto_skcipher_ctx(tfm);
887 unsigned ivsize = crypto_skcipher_ivsize(tfm);
974 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
975 struct ixp_ctx *ctx = crypto_skcipher_ctx(tfm);
997 struct crypto_aead *tfm = crypto_aead_reqtfm(req);
998 struct ixp_ctx *ctx = crypto_aead_ctx(tfm);
999 unsigned ivsize = crypto_aead_ivsize(tfm);
1000 unsigned authsize = crypto_aead_authsize(tfm);
1108 static int aead_setup(struct crypto_aead *tfm, unsigned int authsize)
1110 struct ixp_ctx *ctx = crypto_aead_ctx(tfm);
1111 unsigned digest_len = crypto_aead_maxauthsize(tfm);
1122 ret = setup_cipher(&tfm->base, 0, ctx->enckey, ctx->enckey_len);
1125 ret = setup_cipher(&tfm->base, 1, ctx->enckey, ctx->enckey_len);
1128 ret = setup_auth(&tfm->base, 0, authsize, ctx->authkey,
1132 ret = setup_auth(&tfm->base, 1, authsize, ctx->authkey,
1140 static int aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize)
1142 int max = crypto_aead_maxauthsize(tfm) >> 2;
1146 return aead_setup(tfm, authsize);
1149 static int aead_setkey(struct crypto_aead *tfm, const u8 *key,
1152 struct ixp_ctx *ctx = crypto_aead_ctx(tfm);
1170 return aead_setup(tfm, crypto_aead_authsize(tfm));
1176 static int des3_aead_setkey(struct crypto_aead *tfm, const u8 *key,
1179 struct ixp_ctx *ctx = crypto_aead_ctx(tfm);
1191 err = verify_aead_des3_key(tfm, keys.enckey, keys.enckeylen);
1201 return aead_setup(tfm, crypto_aead_authsize(tfm));