Lines Matching refs:tfm

620 static int safexcel_ahash_exit_inv(struct crypto_tfm *tfm)  in safexcel_ahash_exit_inv()  argument
622 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_ahash_exit_inv()
637 ahash_request_set_tfm(req, __crypto_ahash_cast(tfm)); in safexcel_ahash_exit_inv()
638 ctx = crypto_tfm_ctx(req->base.tfm); in safexcel_ahash_exit_inv()
916 static int safexcel_ahash_cra_init(struct crypto_tfm *tfm) in safexcel_ahash_cra_init() argument
918 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_ahash_cra_init()
920 container_of(__crypto_ahash_alg(tfm->__crt_alg), in safexcel_ahash_cra_init()
928 crypto_ahash_set_reqsize_dma(__crypto_ahash_cast(tfm), in safexcel_ahash_cra_init()
959 static void safexcel_ahash_cra_exit(struct crypto_tfm *tfm) in safexcel_ahash_cra_exit() argument
961 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_ahash_cra_exit()
970 ret = safexcel_ahash_exit_inv(tfm); in safexcel_ahash_cra_exit()
1119 struct crypto_ahash *tfm; in __safexcel_hmac_setkey() local
1124 tfm = crypto_alloc_ahash(alg, 0, 0); in __safexcel_hmac_setkey()
1125 if (IS_ERR(tfm)) in __safexcel_hmac_setkey()
1126 return PTR_ERR(tfm); in __safexcel_hmac_setkey()
1128 areq = ahash_request_alloc(tfm, GFP_KERNEL); in __safexcel_hmac_setkey()
1134 crypto_ahash_clear_flags(tfm, ~0); in __safexcel_hmac_setkey()
1135 blocksize = crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm)); in __safexcel_hmac_setkey()
1160 crypto_free_ahash(tfm); in __safexcel_hmac_setkey()
1188 static int safexcel_hmac_alg_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_alg_setkey() argument
1192 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_hmac_alg_setkey()
1197 static int safexcel_hmac_sha1_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sha1_setkey() argument
1200 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-sha1", in safexcel_hmac_sha1_setkey()
1350 static int safexcel_hmac_sha224_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sha224_setkey() argument
1353 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-sha224", in safexcel_hmac_sha224_setkey()
1422 static int safexcel_hmac_sha256_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sha256_setkey() argument
1425 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-sha256", in safexcel_hmac_sha256_setkey()
1608 static int safexcel_hmac_sha512_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sha512_setkey() argument
1611 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-sha512", in safexcel_hmac_sha512_setkey()
1680 static int safexcel_hmac_sha384_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sha384_setkey() argument
1683 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-sha384", in safexcel_hmac_sha384_setkey()
1833 static int safexcel_hmac_md5_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_md5_setkey() argument
1836 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-md5", in safexcel_hmac_md5_setkey()
1904 static int safexcel_cbcmac_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_cbcmac_setkey() argument
1907 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(crypto_ahash_tfm(tfm)); in safexcel_cbcmac_setkey()
1972 static int safexcel_xcbcmac_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_xcbcmac_setkey() argument
1975 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(crypto_ahash_tfm(tfm)); in safexcel_xcbcmac_setkey()
2006 static int safexcel_xcbcmac_cra_init(struct crypto_tfm *tfm) in safexcel_xcbcmac_cra_init() argument
2008 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_xcbcmac_cra_init()
2010 safexcel_ahash_cra_init(tfm); in safexcel_xcbcmac_cra_init()
2015 static void safexcel_xcbcmac_cra_exit(struct crypto_tfm *tfm) in safexcel_xcbcmac_cra_exit() argument
2017 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_xcbcmac_cra_exit()
2020 safexcel_ahash_cra_exit(tfm); in safexcel_xcbcmac_cra_exit()
2055 static int safexcel_cmac_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_cmac_setkey() argument
2058 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(crypto_ahash_tfm(tfm)); in safexcel_cmac_setkey()
2199 static int safexcel_hmac_sm3_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sm3_setkey() argument
2202 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-sm3", in safexcel_hmac_sm3_setkey()
2273 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_sha3_224_init() local
2274 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_224_init()
2291 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_fbcheck() local
2292 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_fbcheck()
2328 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_update() local
2329 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_update()
2338 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_final() local
2339 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_final()
2348 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_finup() local
2349 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_finup()
2363 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_digest_fallback() local
2364 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_digest_fallback()
2383 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_export() local
2384 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_export()
2393 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_import() local
2394 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_import()
2402 static int safexcel_sha3_cra_init(struct crypto_tfm *tfm) in safexcel_sha3_cra_init() argument
2404 struct crypto_ahash *ahash = __crypto_ahash_cast(tfm); in safexcel_sha3_cra_init()
2405 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_sha3_cra_init()
2407 safexcel_ahash_cra_init(tfm); in safexcel_sha3_cra_init()
2410 ctx->fback = crypto_alloc_ahash(crypto_tfm_alg_name(tfm), 0, in safexcel_sha3_cra_init()
2426 static void safexcel_sha3_cra_exit(struct crypto_tfm *tfm) in safexcel_sha3_cra_exit() argument
2428 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_sha3_cra_exit()
2431 safexcel_ahash_cra_exit(tfm); in safexcel_sha3_cra_exit()
2467 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_sha3_256_init() local
2468 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_256_init()
2525 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_sha3_384_init() local
2526 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_384_init()
2583 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_sha3_512_init() local
2584 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_512_init()
2639 static int safexcel_hmac_sha3_cra_init(struct crypto_tfm *tfm, const char *alg) in safexcel_hmac_sha3_cra_init() argument
2641 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_hmac_sha3_cra_init()
2644 ret = safexcel_sha3_cra_init(tfm); in safexcel_hmac_sha3_cra_init()
2659 ctx->shdesc->tfm = ctx->shpre; in safexcel_hmac_sha3_cra_init()
2663 static void safexcel_hmac_sha3_cra_exit(struct crypto_tfm *tfm) in safexcel_hmac_sha3_cra_exit() argument
2665 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_hmac_sha3_cra_exit()
2670 safexcel_ahash_cra_exit(tfm); in safexcel_hmac_sha3_cra_exit()
2673 static int safexcel_hmac_sha3_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sha3_setkey() argument
2676 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_hmac_sha3_setkey()
2679 if (keylen > crypto_ahash_blocksize(tfm)) { in safexcel_hmac_sha3_setkey()
2692 if (keylen > crypto_ahash_blocksize(tfm) / 2) in safexcel_hmac_sha3_setkey()
2696 crypto_ahash_blocksize(tfm) / 2, in safexcel_hmac_sha3_setkey()
2697 keylen - crypto_ahash_blocksize(tfm) / 2); in safexcel_hmac_sha3_setkey()
2704 if (keylen <= crypto_ahash_blocksize(tfm) / 2) { in safexcel_hmac_sha3_setkey()
2708 crypto_ahash_blocksize(tfm) / 2); in safexcel_hmac_sha3_setkey()
2710 key + crypto_ahash_blocksize(tfm) / 2, in safexcel_hmac_sha3_setkey()
2711 keylen - crypto_ahash_blocksize(tfm) / 2); in safexcel_hmac_sha3_setkey()
2716 if (keylen <= crypto_ahash_blocksize(tfm) / 2) { in safexcel_hmac_sha3_setkey()
2718 crypto_ahash_blocksize(tfm) / 2 - keylen); in safexcel_hmac_sha3_setkey()
2719 memset(&ctx->base.opad, 0, crypto_ahash_blocksize(tfm) / 2); in safexcel_hmac_sha3_setkey()
2722 crypto_ahash_blocksize(tfm) / 2, 0, in safexcel_hmac_sha3_setkey()
2723 crypto_ahash_blocksize(tfm) - keylen); in safexcel_hmac_sha3_setkey()
2733 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_hmac_sha3_224_init() local
2734 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_hmac_sha3_224_init()
2765 static int safexcel_hmac_sha3_224_cra_init(struct crypto_tfm *tfm) in safexcel_hmac_sha3_224_cra_init() argument
2767 return safexcel_hmac_sha3_cra_init(tfm, "sha3-224"); in safexcel_hmac_sha3_224_cra_init()
2804 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_hmac_sha3_256_init() local
2805 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_hmac_sha3_256_init()
2836 static int safexcel_hmac_sha3_256_cra_init(struct crypto_tfm *tfm) in safexcel_hmac_sha3_256_cra_init() argument
2838 return safexcel_hmac_sha3_cra_init(tfm, "sha3-256"); in safexcel_hmac_sha3_256_cra_init()
2875 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_hmac_sha3_384_init() local
2876 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_hmac_sha3_384_init()
2907 static int safexcel_hmac_sha3_384_cra_init(struct crypto_tfm *tfm) in safexcel_hmac_sha3_384_cra_init() argument
2909 return safexcel_hmac_sha3_cra_init(tfm, "sha3-384"); in safexcel_hmac_sha3_384_cra_init()
2946 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_hmac_sha3_512_init() local
2947 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_hmac_sha3_512_init()
2978 static int safexcel_hmac_sha3_512_cra_init(struct crypto_tfm *tfm) in safexcel_hmac_sha3_512_cra_init() argument
2980 return safexcel_hmac_sha3_cra_init(tfm, "sha3-512"); in safexcel_hmac_sha3_512_cra_init()