Lines Matching defs:tfm

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