Lines Matching refs:tfm
622 static int safexcel_ahash_exit_inv(struct crypto_tfm *tfm) in safexcel_ahash_exit_inv() argument
624 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_ahash_exit_inv()
639 ahash_request_set_tfm(req, __crypto_ahash_cast(tfm)); in safexcel_ahash_exit_inv()
640 ctx = crypto_tfm_ctx(req->base.tfm); in safexcel_ahash_exit_inv()
918 static int safexcel_ahash_cra_init(struct crypto_tfm *tfm) in safexcel_ahash_cra_init() argument
920 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_ahash_cra_init()
922 container_of(__crypto_ahash_alg(tfm->__crt_alg), in safexcel_ahash_cra_init()
930 crypto_ahash_set_reqsize_dma(__crypto_ahash_cast(tfm), in safexcel_ahash_cra_init()
961 static void safexcel_ahash_cra_exit(struct crypto_tfm *tfm) in safexcel_ahash_cra_exit() argument
963 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_ahash_cra_exit()
972 ret = safexcel_ahash_exit_inv(tfm); in safexcel_ahash_cra_exit()
1121 struct crypto_ahash *tfm; in __safexcel_hmac_setkey() local
1126 tfm = crypto_alloc_ahash(alg, 0, 0); in __safexcel_hmac_setkey()
1127 if (IS_ERR(tfm)) in __safexcel_hmac_setkey()
1128 return PTR_ERR(tfm); in __safexcel_hmac_setkey()
1130 areq = ahash_request_alloc(tfm, GFP_KERNEL); in __safexcel_hmac_setkey()
1136 crypto_ahash_clear_flags(tfm, ~0); in __safexcel_hmac_setkey()
1137 blocksize = crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm)); in __safexcel_hmac_setkey()
1162 crypto_free_ahash(tfm); in __safexcel_hmac_setkey()
1190 static int safexcel_hmac_alg_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_alg_setkey() argument
1194 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_hmac_alg_setkey()
1199 static int safexcel_hmac_sha1_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sha1_setkey() argument
1202 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-sha1", in safexcel_hmac_sha1_setkey()
1352 static int safexcel_hmac_sha224_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sha224_setkey() argument
1355 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-sha224", in safexcel_hmac_sha224_setkey()
1424 static int safexcel_hmac_sha256_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sha256_setkey() argument
1427 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-sha256", in safexcel_hmac_sha256_setkey()
1610 static int safexcel_hmac_sha512_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sha512_setkey() argument
1613 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-sha512", in safexcel_hmac_sha512_setkey()
1682 static int safexcel_hmac_sha384_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sha384_setkey() argument
1685 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-sha384", in safexcel_hmac_sha384_setkey()
1835 static int safexcel_hmac_md5_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_md5_setkey() argument
1838 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-md5", in safexcel_hmac_md5_setkey()
1884 static int safexcel_crc32_cra_init(struct crypto_tfm *tfm) in safexcel_crc32_cra_init() argument
1886 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_crc32_cra_init()
1887 int ret = safexcel_ahash_cra_init(tfm); in safexcel_crc32_cra_init()
1916 static int safexcel_crc32_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_crc32_setkey() argument
1919 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(crypto_ahash_tfm(tfm)); in safexcel_crc32_setkey()
1988 static int safexcel_cbcmac_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_cbcmac_setkey() argument
1991 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(crypto_ahash_tfm(tfm)); in safexcel_cbcmac_setkey()
2056 static int safexcel_xcbcmac_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_xcbcmac_setkey() argument
2059 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(crypto_ahash_tfm(tfm)); in safexcel_xcbcmac_setkey()
2090 static int safexcel_xcbcmac_cra_init(struct crypto_tfm *tfm) in safexcel_xcbcmac_cra_init() argument
2092 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_xcbcmac_cra_init()
2094 safexcel_ahash_cra_init(tfm); in safexcel_xcbcmac_cra_init()
2099 static void safexcel_xcbcmac_cra_exit(struct crypto_tfm *tfm) in safexcel_xcbcmac_cra_exit() argument
2101 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_xcbcmac_cra_exit()
2104 safexcel_ahash_cra_exit(tfm); in safexcel_xcbcmac_cra_exit()
2139 static int safexcel_cmac_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_cmac_setkey() argument
2142 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(crypto_ahash_tfm(tfm)); in safexcel_cmac_setkey()
2283 static int safexcel_hmac_sm3_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sm3_setkey() argument
2286 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-sm3", in safexcel_hmac_sm3_setkey()
2357 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_sha3_224_init() local
2358 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_224_init()
2375 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_fbcheck() local
2376 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_fbcheck()
2412 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_update() local
2413 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_update()
2422 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_final() local
2423 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_final()
2432 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_finup() local
2433 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_finup()
2447 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_digest_fallback() local
2448 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_digest_fallback()
2467 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_export() local
2468 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_export()
2477 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_import() local
2478 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_import()
2486 static int safexcel_sha3_cra_init(struct crypto_tfm *tfm) in safexcel_sha3_cra_init() argument
2488 struct crypto_ahash *ahash = __crypto_ahash_cast(tfm); in safexcel_sha3_cra_init()
2489 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_sha3_cra_init()
2491 safexcel_ahash_cra_init(tfm); in safexcel_sha3_cra_init()
2494 ctx->fback = crypto_alloc_ahash(crypto_tfm_alg_name(tfm), 0, in safexcel_sha3_cra_init()
2510 static void safexcel_sha3_cra_exit(struct crypto_tfm *tfm) in safexcel_sha3_cra_exit() argument
2512 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_sha3_cra_exit()
2515 safexcel_ahash_cra_exit(tfm); in safexcel_sha3_cra_exit()
2551 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_sha3_256_init() local
2552 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_256_init()
2609 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_sha3_384_init() local
2610 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_384_init()
2667 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_sha3_512_init() local
2668 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_512_init()
2723 static int safexcel_hmac_sha3_cra_init(struct crypto_tfm *tfm, const char *alg) in safexcel_hmac_sha3_cra_init() argument
2725 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_hmac_sha3_cra_init()
2728 ret = safexcel_sha3_cra_init(tfm); in safexcel_hmac_sha3_cra_init()
2743 ctx->shdesc->tfm = ctx->shpre; in safexcel_hmac_sha3_cra_init()
2747 static void safexcel_hmac_sha3_cra_exit(struct crypto_tfm *tfm) in safexcel_hmac_sha3_cra_exit() argument
2749 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_hmac_sha3_cra_exit()
2754 safexcel_ahash_cra_exit(tfm); in safexcel_hmac_sha3_cra_exit()
2757 static int safexcel_hmac_sha3_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sha3_setkey() argument
2760 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_hmac_sha3_setkey()
2763 if (keylen > crypto_ahash_blocksize(tfm)) { in safexcel_hmac_sha3_setkey()
2776 if (keylen > crypto_ahash_blocksize(tfm) / 2) in safexcel_hmac_sha3_setkey()
2780 crypto_ahash_blocksize(tfm) / 2, in safexcel_hmac_sha3_setkey()
2781 keylen - crypto_ahash_blocksize(tfm) / 2); in safexcel_hmac_sha3_setkey()
2788 if (keylen <= crypto_ahash_blocksize(tfm) / 2) { in safexcel_hmac_sha3_setkey()
2792 crypto_ahash_blocksize(tfm) / 2); in safexcel_hmac_sha3_setkey()
2794 key + crypto_ahash_blocksize(tfm) / 2, in safexcel_hmac_sha3_setkey()
2795 keylen - crypto_ahash_blocksize(tfm) / 2); in safexcel_hmac_sha3_setkey()
2800 if (keylen <= crypto_ahash_blocksize(tfm) / 2) { in safexcel_hmac_sha3_setkey()
2802 crypto_ahash_blocksize(tfm) / 2 - keylen); in safexcel_hmac_sha3_setkey()
2803 memset(&ctx->base.opad, 0, crypto_ahash_blocksize(tfm) / 2); in safexcel_hmac_sha3_setkey()
2806 crypto_ahash_blocksize(tfm) / 2, 0, in safexcel_hmac_sha3_setkey()
2807 crypto_ahash_blocksize(tfm) - keylen); in safexcel_hmac_sha3_setkey()
2817 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_hmac_sha3_224_init() local
2818 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_hmac_sha3_224_init()
2849 static int safexcel_hmac_sha3_224_cra_init(struct crypto_tfm *tfm) in safexcel_hmac_sha3_224_cra_init() argument
2851 return safexcel_hmac_sha3_cra_init(tfm, "sha3-224"); in safexcel_hmac_sha3_224_cra_init()
2888 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_hmac_sha3_256_init() local
2889 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_hmac_sha3_256_init()
2920 static int safexcel_hmac_sha3_256_cra_init(struct crypto_tfm *tfm) in safexcel_hmac_sha3_256_cra_init() argument
2922 return safexcel_hmac_sha3_cra_init(tfm, "sha3-256"); in safexcel_hmac_sha3_256_cra_init()
2959 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_hmac_sha3_384_init() local
2960 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_hmac_sha3_384_init()
2991 static int safexcel_hmac_sha3_384_cra_init(struct crypto_tfm *tfm) in safexcel_hmac_sha3_384_cra_init() argument
2993 return safexcel_hmac_sha3_cra_init(tfm, "sha3-384"); in safexcel_hmac_sha3_384_cra_init()
3030 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_hmac_sha3_512_init() local
3031 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_hmac_sha3_512_init()
3062 static int safexcel_hmac_sha3_512_cra_init(struct crypto_tfm *tfm) in safexcel_hmac_sha3_512_cra_init() argument
3064 return safexcel_hmac_sha3_cra_init(tfm, "sha3-512"); in safexcel_hmac_sha3_512_cra_init()