Lines Matching refs:tfm
685 static int sec_skcipher_fbtfm_init(struct crypto_skcipher *tfm) in sec_skcipher_fbtfm_init() argument
687 const char *alg = crypto_tfm_alg_name(&tfm->base); in sec_skcipher_fbtfm_init()
688 struct sec_ctx *ctx = crypto_skcipher_ctx(tfm); in sec_skcipher_fbtfm_init()
707 static int sec_skcipher_init(struct crypto_skcipher *tfm) in sec_skcipher_init() argument
709 struct sec_ctx *ctx = crypto_skcipher_ctx(tfm); in sec_skcipher_init()
713 crypto_skcipher_set_reqsize(tfm, sizeof(struct sec_req)); in sec_skcipher_init()
714 ctx->c_ctx.ivsize = crypto_skcipher_ivsize(tfm); in sec_skcipher_init()
728 ret = sec_skcipher_fbtfm_init(tfm); in sec_skcipher_init()
741 static void sec_skcipher_uninit(struct crypto_skcipher *tfm) in sec_skcipher_uninit() argument
743 struct sec_ctx *ctx = crypto_skcipher_ctx(tfm); in sec_skcipher_uninit()
752 static int sec_skcipher_3des_setkey(struct crypto_skcipher *tfm, const u8 *key, in sec_skcipher_3des_setkey() argument
756 struct sec_ctx *ctx = crypto_skcipher_ctx(tfm); in sec_skcipher_3des_setkey()
760 ret = verify_skcipher_des3_key(tfm, key); in sec_skcipher_3des_setkey()
823 static int sec_skcipher_setkey(struct crypto_skcipher *tfm, const u8 *key, in sec_skcipher_setkey() argument
827 struct sec_ctx *ctx = crypto_skcipher_ctx(tfm); in sec_skcipher_setkey()
833 ret = xts_verify_key(tfm, key, keylen); in sec_skcipher_setkey()
845 ret = sec_skcipher_3des_setkey(tfm, key, keylen, c_mode); in sec_skcipher_setkey()
872 static int sec_setkey_##name(struct crypto_skcipher *tfm, const u8 *key,\
875 return sec_skcipher_setkey(tfm, key, keylen, c_alg, c_mode); \
902 struct crypto_aead *tfm; in GEN_SEC_SETKEY_FUNC() local
918 tfm = crypto_aead_reqtfm(aead_req); in GEN_SEC_SETKEY_FUNC()
919 authsize = crypto_aead_authsize(tfm); in GEN_SEC_SETKEY_FUNC()
953 struct crypto_aead *tfm = crypto_aead_reqtfm(aead_req); in sec_aead_mac_init() local
954 size_t authsize = crypto_aead_authsize(tfm); in sec_aead_mac_init()
1122 struct crypto_tfm *tfm = crypto_aead_tfm(aead); in sec_aead_setauthsize() local
1123 struct sec_ctx *ctx = crypto_tfm_ctx(tfm); in sec_aead_setauthsize()
1133 struct crypto_aead *tfm, const u8 *key, in sec_aead_fallback_setkey() argument
1138 crypto_aead_get_flags(tfm) & CRYPTO_TFM_REQ_MASK); in sec_aead_fallback_setkey()
1142 static int sec_aead_setkey(struct crypto_aead *tfm, const u8 *key, in sec_aead_setkey() argument
1148 struct sec_ctx *ctx = crypto_aead_ctx(tfm); in sec_aead_setkey()
1169 ret = sec_aead_fallback_setkey(a_ctx, tfm, key, keylen); in sec_aead_setkey()
1207 static int sec_setkey_##name(struct crypto_aead *tfm, const u8 *key, \
1210 return sec_aead_setkey(tfm, key, keylen, aalg, calg, maclen, cmode);\
1517 struct crypto_aead *tfm = crypto_aead_reqtfm(aead_req); in sec_aead_set_iv() local
1518 size_t authsize = crypto_aead_authsize(tfm); in sec_aead_set_iv()
1706 struct crypto_aead *tfm = crypto_aead_reqtfm(a_req); in sec_aead_callback() local
1709 size_t authsize = crypto_aead_authsize(tfm); in sec_aead_callback()
1855 static int sec_skcipher_ctx_init(struct crypto_skcipher *tfm) in sec_skcipher_ctx_init() argument
1857 struct sec_ctx *ctx = crypto_skcipher_ctx(tfm); in sec_skcipher_ctx_init()
1860 ret = sec_skcipher_init(tfm); in sec_skcipher_ctx_init()
1875 static void sec_skcipher_ctx_exit(struct crypto_skcipher *tfm) in sec_skcipher_ctx_exit() argument
1877 sec_skcipher_uninit(tfm); in sec_skcipher_ctx_exit()
1880 static int sec_aead_init(struct crypto_aead *tfm) in sec_aead_init() argument
1882 struct sec_ctx *ctx = crypto_aead_ctx(tfm); in sec_aead_init()
1885 crypto_aead_set_reqsize(tfm, sizeof(struct sec_req)); in sec_aead_init()
1887 ctx->c_ctx.ivsize = crypto_aead_ivsize(tfm); in sec_aead_init()
1922 static void sec_aead_exit(struct crypto_aead *tfm) in sec_aead_exit() argument
1924 struct sec_ctx *ctx = crypto_aead_ctx(tfm); in sec_aead_exit()
1931 static int sec_aead_ctx_init(struct crypto_aead *tfm, const char *hash_name) in sec_aead_ctx_init() argument
1933 struct sec_ctx *ctx = crypto_aead_ctx(tfm); in sec_aead_ctx_init()
1937 ret = sec_aead_init(tfm); in sec_aead_ctx_init()
1946 sec_aead_exit(tfm); in sec_aead_ctx_init()
1953 static void sec_aead_ctx_exit(struct crypto_aead *tfm) in sec_aead_ctx_exit() argument
1955 struct sec_ctx *ctx = crypto_aead_ctx(tfm); in sec_aead_ctx_exit()
1958 sec_aead_exit(tfm); in sec_aead_ctx_exit()
1961 static int sec_aead_xcm_ctx_init(struct crypto_aead *tfm) in sec_aead_xcm_ctx_init() argument
1963 struct aead_alg *alg = crypto_aead_alg(tfm); in sec_aead_xcm_ctx_init()
1964 struct sec_ctx *ctx = crypto_aead_ctx(tfm); in sec_aead_xcm_ctx_init()
1969 ret = sec_aead_init(tfm); in sec_aead_xcm_ctx_init()
1980 sec_aead_exit(tfm); in sec_aead_xcm_ctx_init()
1988 static void sec_aead_xcm_ctx_exit(struct crypto_aead *tfm) in sec_aead_xcm_ctx_exit() argument
1990 struct sec_ctx *ctx = crypto_aead_ctx(tfm); in sec_aead_xcm_ctx_exit()
1993 sec_aead_exit(tfm); in sec_aead_xcm_ctx_exit()
1996 static int sec_aead_sha1_ctx_init(struct crypto_aead *tfm) in sec_aead_sha1_ctx_init() argument
1998 return sec_aead_ctx_init(tfm, "sha1"); in sec_aead_sha1_ctx_init()
2001 static int sec_aead_sha256_ctx_init(struct crypto_aead *tfm) in sec_aead_sha256_ctx_init() argument
2003 return sec_aead_ctx_init(tfm, "sha256"); in sec_aead_sha256_ctx_init()
2006 static int sec_aead_sha512_ctx_init(struct crypto_aead *tfm) in sec_aead_sha512_ctx_init() argument
2008 return sec_aead_ctx_init(tfm, "sha512"); in sec_aead_sha512_ctx_init()
2113 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(sk_req); in sec_skcipher_crypto() local
2115 struct sec_ctx *ctx = crypto_skcipher_ctx(tfm); in sec_skcipher_crypto()
2263 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in sec_aead_spec_check() local
2264 size_t authsize = crypto_aead_authsize(tfm); in sec_aead_spec_check()
2311 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in sec_aead_param_check() local
2312 size_t authsize = crypto_aead_authsize(tfm); in sec_aead_param_check()
2384 struct crypto_aead *tfm = crypto_aead_reqtfm(a_req); in sec_aead_crypto() local
2386 struct sec_ctx *ctx = crypto_aead_ctx(tfm); in sec_aead_crypto()