• Home
  • Raw
  • Download

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()
638 ahash_request_set_tfm(req, __crypto_ahash_cast(tfm)); in safexcel_ahash_exit_inv()
639 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(__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()
1147 struct crypto_ahash *tfm; in __safexcel_hmac_setkey() local
1152 tfm = crypto_alloc_ahash(alg, 0, 0); in __safexcel_hmac_setkey()
1153 if (IS_ERR(tfm)) in __safexcel_hmac_setkey()
1154 return PTR_ERR(tfm); in __safexcel_hmac_setkey()
1156 areq = ahash_request_alloc(tfm, GFP_KERNEL); in __safexcel_hmac_setkey()
1162 crypto_ahash_clear_flags(tfm, ~0); in __safexcel_hmac_setkey()
1163 blocksize = crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm)); in __safexcel_hmac_setkey()
1188 crypto_free_ahash(tfm); in __safexcel_hmac_setkey()
1216 static int safexcel_hmac_alg_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_alg_setkey() argument
1220 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_hmac_alg_setkey()
1225 static int safexcel_hmac_sha1_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sha1_setkey() argument
1228 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-sha1", in safexcel_hmac_sha1_setkey()
1378 static int safexcel_hmac_sha224_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sha224_setkey() argument
1381 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-sha224", in safexcel_hmac_sha224_setkey()
1450 static int safexcel_hmac_sha256_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sha256_setkey() argument
1453 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-sha256", in safexcel_hmac_sha256_setkey()
1636 static int safexcel_hmac_sha512_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sha512_setkey() argument
1639 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-sha512", in safexcel_hmac_sha512_setkey()
1708 static int safexcel_hmac_sha384_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sha384_setkey() argument
1711 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-sha384", in safexcel_hmac_sha384_setkey()
1861 static int safexcel_hmac_md5_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_md5_setkey() argument
1864 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-md5", in safexcel_hmac_md5_setkey()
1910 static int safexcel_crc32_cra_init(struct crypto_tfm *tfm) in safexcel_crc32_cra_init() argument
1912 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_crc32_cra_init()
1913 int ret = safexcel_ahash_cra_init(tfm); in safexcel_crc32_cra_init()
1942 static int safexcel_crc32_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_crc32_setkey() argument
1945 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(crypto_ahash_tfm(tfm)); in safexcel_crc32_setkey()
2014 static int safexcel_cbcmac_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_cbcmac_setkey() argument
2017 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(crypto_ahash_tfm(tfm)); in safexcel_cbcmac_setkey()
2082 static int safexcel_xcbcmac_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_xcbcmac_setkey() argument
2085 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(crypto_ahash_tfm(tfm)); in safexcel_xcbcmac_setkey()
2096 crypto_cipher_set_flags(ctx->kaes, crypto_ahash_get_flags(tfm) & in safexcel_xcbcmac_setkey()
2112 crypto_cipher_set_flags(ctx->kaes, crypto_ahash_get_flags(tfm) & in safexcel_xcbcmac_setkey()
2128 static int safexcel_xcbcmac_cra_init(struct crypto_tfm *tfm) in safexcel_xcbcmac_cra_init() argument
2130 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_xcbcmac_cra_init()
2132 safexcel_ahash_cra_init(tfm); in safexcel_xcbcmac_cra_init()
2137 static void safexcel_xcbcmac_cra_exit(struct crypto_tfm *tfm) in safexcel_xcbcmac_cra_exit() argument
2139 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_xcbcmac_cra_exit()
2142 safexcel_ahash_cra_exit(tfm); in safexcel_xcbcmac_cra_exit()
2177 static int safexcel_cmac_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_cmac_setkey() argument
2180 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(crypto_ahash_tfm(tfm)); in safexcel_cmac_setkey()
2196 crypto_cipher_set_flags(ctx->kaes, crypto_ahash_get_flags(tfm) & in safexcel_cmac_setkey()
2330 static int safexcel_hmac_sm3_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sm3_setkey() argument
2333 return safexcel_hmac_alg_setkey(tfm, key, keylen, "safexcel-sm3", in safexcel_hmac_sm3_setkey()
2404 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_sha3_224_init() local
2405 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_224_init()
2422 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_fbcheck() local
2423 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_fbcheck()
2459 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_update() local
2460 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_update()
2469 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_final() local
2470 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_final()
2479 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_finup() local
2480 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_finup()
2494 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_digest_fallback() local
2495 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_digest_fallback()
2514 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_export() local
2515 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_export()
2524 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in safexcel_sha3_import() local
2525 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_import()
2533 static int safexcel_sha3_cra_init(struct crypto_tfm *tfm) in safexcel_sha3_cra_init() argument
2535 struct crypto_ahash *ahash = __crypto_ahash_cast(tfm); in safexcel_sha3_cra_init()
2536 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_sha3_cra_init()
2538 safexcel_ahash_cra_init(tfm); in safexcel_sha3_cra_init()
2541 ctx->fback = crypto_alloc_ahash(crypto_tfm_alg_name(tfm), 0, in safexcel_sha3_cra_init()
2556 static void safexcel_sha3_cra_exit(struct crypto_tfm *tfm) in safexcel_sha3_cra_exit() argument
2558 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_sha3_cra_exit()
2561 safexcel_ahash_cra_exit(tfm); in safexcel_sha3_cra_exit()
2597 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_sha3_256_init() local
2598 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_256_init()
2655 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_sha3_384_init() local
2656 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_384_init()
2713 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_sha3_512_init() local
2714 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_sha3_512_init()
2769 static int safexcel_hmac_sha3_cra_init(struct crypto_tfm *tfm, const char *alg) in safexcel_hmac_sha3_cra_init() argument
2771 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_hmac_sha3_cra_init()
2774 ret = safexcel_sha3_cra_init(tfm); in safexcel_hmac_sha3_cra_init()
2789 ctx->shdesc->tfm = ctx->shpre; in safexcel_hmac_sha3_cra_init()
2793 static void safexcel_hmac_sha3_cra_exit(struct crypto_tfm *tfm) in safexcel_hmac_sha3_cra_exit() argument
2795 struct safexcel_ahash_ctx *ctx = crypto_tfm_ctx(tfm); in safexcel_hmac_sha3_cra_exit()
2800 safexcel_ahash_cra_exit(tfm); in safexcel_hmac_sha3_cra_exit()
2803 static int safexcel_hmac_sha3_setkey(struct crypto_ahash *tfm, const u8 *key, in safexcel_hmac_sha3_setkey() argument
2806 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_hmac_sha3_setkey()
2809 if (keylen > crypto_ahash_blocksize(tfm)) { in safexcel_hmac_sha3_setkey()
2822 if (keylen > crypto_ahash_blocksize(tfm) / 2) in safexcel_hmac_sha3_setkey()
2826 crypto_ahash_blocksize(tfm) / 2, in safexcel_hmac_sha3_setkey()
2827 keylen - crypto_ahash_blocksize(tfm) / 2); in safexcel_hmac_sha3_setkey()
2834 if (keylen <= crypto_ahash_blocksize(tfm) / 2) { in safexcel_hmac_sha3_setkey()
2838 crypto_ahash_blocksize(tfm) / 2); in safexcel_hmac_sha3_setkey()
2840 key + crypto_ahash_blocksize(tfm) / 2, in safexcel_hmac_sha3_setkey()
2841 keylen - crypto_ahash_blocksize(tfm) / 2); in safexcel_hmac_sha3_setkey()
2846 if (keylen <= crypto_ahash_blocksize(tfm) / 2) { in safexcel_hmac_sha3_setkey()
2848 crypto_ahash_blocksize(tfm) / 2 - keylen); in safexcel_hmac_sha3_setkey()
2849 memset(&ctx->base.opad, 0, crypto_ahash_blocksize(tfm) / 2); in safexcel_hmac_sha3_setkey()
2852 crypto_ahash_blocksize(tfm) / 2, 0, in safexcel_hmac_sha3_setkey()
2853 crypto_ahash_blocksize(tfm) - keylen); in safexcel_hmac_sha3_setkey()
2863 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_hmac_sha3_224_init() local
2864 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_hmac_sha3_224_init()
2895 static int safexcel_hmac_sha3_224_cra_init(struct crypto_tfm *tfm) in safexcel_hmac_sha3_224_cra_init() argument
2897 return safexcel_hmac_sha3_cra_init(tfm, "sha3-224"); in safexcel_hmac_sha3_224_cra_init()
2934 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_hmac_sha3_256_init() local
2935 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_hmac_sha3_256_init()
2966 static int safexcel_hmac_sha3_256_cra_init(struct crypto_tfm *tfm) in safexcel_hmac_sha3_256_cra_init() argument
2968 return safexcel_hmac_sha3_cra_init(tfm, "sha3-256"); in safexcel_hmac_sha3_256_cra_init()
3005 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_hmac_sha3_384_init() local
3006 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_hmac_sha3_384_init()
3037 static int safexcel_hmac_sha3_384_cra_init(struct crypto_tfm *tfm) in safexcel_hmac_sha3_384_cra_init() argument
3039 return safexcel_hmac_sha3_cra_init(tfm, "sha3-384"); in safexcel_hmac_sha3_384_cra_init()
3076 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in safexcel_hmac_sha3_512_init() local
3077 struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(tfm); in safexcel_hmac_sha3_512_init()
3108 static int safexcel_hmac_sha3_512_cra_init(struct crypto_tfm *tfm) in safexcel_hmac_sha3_512_cra_init() argument
3110 return safexcel_hmac_sha3_cra_init(tfm, "sha3-512"); in safexcel_hmac_sha3_512_cra_init()