Home
last modified time | relevance | path

Searched refs:shash (Results 1 – 25 of 60) sorted by relevance

123

/Linux-v6.1/drivers/nvme/target/
Dauth.c267 struct shash_desc *shash; in nvmet_auth_host_hash() local
324 shash = kzalloc(sizeof(*shash) + crypto_shash_descsize(shash_tfm), in nvmet_auth_host_hash()
326 if (!shash) { in nvmet_auth_host_hash()
330 shash->tfm = shash_tfm; in nvmet_auth_host_hash()
331 ret = crypto_shash_init(shash); in nvmet_auth_host_hash()
334 ret = crypto_shash_update(shash, challenge, shash_len); in nvmet_auth_host_hash()
338 ret = crypto_shash_update(shash, buf, 4); in nvmet_auth_host_hash()
342 ret = crypto_shash_update(shash, buf, 2); in nvmet_auth_host_hash()
346 ret = crypto_shash_update(shash, buf, 1); in nvmet_auth_host_hash()
349 ret = crypto_shash_update(shash, "HostHost", 8); in nvmet_auth_host_hash()
[all …]
/Linux-v6.1/crypto/
Dshash.c45 struct shash_alg *shash = crypto_shash_alg(tfm); in shash_setkey_unaligned() local
58 err = shash->setkey(tfm, alignbuffer, keylen); in shash_setkey_unaligned()
72 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_setkey() local
79 err = shash->setkey(tfm, key, keylen); in crypto_shash_setkey()
82 shash_set_needkey(tfm, shash); in crypto_shash_setkey()
95 struct shash_alg *shash = crypto_shash_alg(tfm); in shash_update_unaligned() local
114 err = shash->update(desc, buf, unaligned_len); in shash_update_unaligned()
118 shash->update(desc, data + unaligned_len, len - unaligned_len); in shash_update_unaligned()
125 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_update() local
131 return shash->update(desc, data, len); in crypto_shash_update()
[all …]
Dhmac.c52 SHASH_DESC_ON_STACK(shash, hash); in hmac_setkey()
58 shash->tfm = hash; in hmac_setkey()
63 err = crypto_shash_digest(shash, inkey, keylen, ipad); in hmac_setkey()
79 return crypto_shash_init(shash) ?: in hmac_setkey()
80 crypto_shash_update(shash, ipad, bs) ?: in hmac_setkey()
81 crypto_shash_export(shash, ipad) ?: in hmac_setkey()
82 crypto_shash_init(shash) ?: in hmac_setkey()
83 crypto_shash_update(shash, opad, bs) ?: in hmac_setkey()
84 crypto_shash_export(shash, opad); in hmac_setkey()
/Linux-v6.1/fs/ksmbd/
Dcrypto_ctx.c31 static void free_shash(struct shash_desc *shash) in free_shash() argument
33 if (shash) { in free_shash()
34 crypto_free_shash(shash->tfm); in free_shash()
35 kfree(shash); in free_shash()
66 struct shash_desc *shash; in alloc_shash_desc() local
91 shash = kzalloc(sizeof(*shash) + crypto_shash_descsize(tfm), in alloc_shash_desc()
93 if (!shash) in alloc_shash_desc()
96 shash->tfm = tfm; in alloc_shash_desc()
97 return shash; in alloc_shash_desc()
/Linux-v6.1/drivers/crypto/vmx/
Dghash.c41 u64 shash[2]; member
51 memset(dctx->shash, 0, GHASH_DIGEST_SIZE); in p8_ghash_init()
83 gcm_ghash_p8(dctx->shash, ctx->htable, in __ghash_block()
89 crypto_xor((u8 *)dctx->shash, dctx->buffer, GHASH_BLOCK_SIZE); in __ghash_block()
90 gf128mul_lle((be128 *)dctx->shash, &ctx->key); in __ghash_block()
102 gcm_ghash_p8(dctx->shash, ctx->htable, in __ghash_blocks()
109 crypto_xor((u8 *)dctx->shash, src, GHASH_BLOCK_SIZE); in __ghash_blocks()
110 gf128mul_lle((be128 *)dctx->shash, &ctx->key); in __ghash_blocks()
165 memcpy(out, dctx->shash, GHASH_DIGEST_SIZE); in p8_ghash_final()
/Linux-v6.1/net/ipv6/
Dseg6_hmac.c123 struct shash_desc *shash; in __do_hmac() local
145 shash = *this_cpu_ptr(algo->shashs); in __do_hmac()
146 shash->tfm = tfm; in __do_hmac()
148 ret = crypto_shash_digest(shash, text, psize, output); in __do_hmac()
355 struct shash_desc *shash; in seg6_hmac_init_algo() local
380 shsize = sizeof(*shash) + crypto_shash_descsize(tfm); in seg6_hmac_init_algo()
387 shash = kzalloc_node(shsize, GFP_KERNEL, in seg6_hmac_init_algo()
389 if (!shash) in seg6_hmac_init_algo()
391 *per_cpu_ptr(algo->shashs, cpu) = shash; in seg6_hmac_init_algo()
420 struct shash_desc *shash; in seg6_hmac_exit() local
[all …]
/Linux-v6.1/security/integrity/ima/
Dima_crypto.c463 SHASH_DESC_ON_STACK(shash, tfm); in ima_calc_file_hash_tfm()
465 shash->tfm = tfm; in ima_calc_file_hash_tfm()
469 rc = crypto_shash_init(shash); in ima_calc_file_hash_tfm()
496 rc = crypto_shash_update(shash, rbuf, rbuf_len); in ima_calc_file_hash_tfm()
503 rc = crypto_shash_final(shash, hash->digest); in ima_calc_file_hash_tfm()
587 SHASH_DESC_ON_STACK(shash, ima_algo_array[tfm_idx].tfm); in ima_calc_field_array_hash_tfm()
592 shash->tfm = ima_algo_array[tfm_idx].tfm; in ima_calc_field_array_hash_tfm()
594 rc = crypto_shash_init(shash); in ima_calc_field_array_hash_tfm()
606 rc = crypto_shash_update(shash, in ima_calc_field_array_hash_tfm()
616 rc = crypto_shash_update(shash, data_to_hash, datalen); in ima_calc_field_array_hash_tfm()
[all …]
/Linux-v6.1/lib/
Dlibcrc32c.c40 SHASH_DESC_ON_STACK(shash, tfm); in crc32c()
41 u32 ret, *ctx = (u32 *)shash_desc_ctx(shash); in crc32c()
44 shash->tfm = tfm; in crc32c()
47 err = crypto_shash_update(shash, address, length); in crc32c()
Ddigsig.c28 static struct crypto_shash *shash; variable
234 desc = kzalloc(sizeof(*desc) + crypto_shash_descsize(shash), in digsig_verify()
239 desc->tfm = shash; in digsig_verify()
261 shash = crypto_alloc_shash("sha1", 0, 0); in digsig_init()
262 if (IS_ERR(shash)) { in digsig_init()
264 return PTR_ERR(shash); in digsig_init()
273 crypto_free_shash(shash); in digsig_cleanup()
Dcrc-t10dif.c66 struct shash_desc shash; in crc_t10dif_update() member
75 desc.shash.tfm = rcu_dereference(crct10dif_tfm); in crc_t10dif_update()
77 err = crypto_shash_update(&desc.shash, buffer, len); in crc_t10dif_update()
Dcrc64-rocksoft.c60 struct shash_desc shash; in crc64_rocksoft_update() member
69 desc.shash.tfm = rcu_dereference(crc64_rocksoft_tfm); in crc64_rocksoft_update()
71 err = crypto_shash_update(&desc.shash, buffer, len); in crc64_rocksoft_update()
/Linux-v6.1/fs/ubifs/
Dauth.c391 SHASH_DESC_ON_STACK(shash, c->hmac_tfm); in ubifs_node_calc_hmac()
398 shash->tfm = c->hmac_tfm; in ubifs_node_calc_hmac()
400 err = crypto_shash_init(shash); in ubifs_node_calc_hmac()
405 err = crypto_shash_update(shash, node + 8, ofs_hmac - 8); in ubifs_node_calc_hmac()
411 err = crypto_shash_update(shash, node + ofs_hmac + hmac_len, in ubifs_node_calc_hmac()
417 return crypto_shash_final(shash, hmac); in ubifs_node_calc_hmac()
511 SHASH_DESC_ON_STACK(shash, c->hmac_tfm); in ubifs_hmac_wkm()
518 shash->tfm = c->hmac_tfm; in ubifs_hmac_wkm()
520 err = crypto_shash_init(shash); in ubifs_hmac_wkm()
524 err = crypto_shash_update(shash, well_known_message, in ubifs_hmac_wkm()
[all …]
/Linux-v6.1/drivers/infiniband/sw/rxe/
Drxe_icrc.c48 SHASH_DESC_ON_STACK(shash, rxe->tfm); in rxe_crc32()
50 shash->tfm = rxe->tfm; in rxe_crc32()
51 *(__be32 *)shash_desc_ctx(shash) = crc; in rxe_crc32()
52 err = crypto_shash_update(shash, next, len); in rxe_crc32()
58 icrc = *(__be32 *)shash_desc_ctx(shash); in rxe_crc32()
59 barrier_data(shash_desc_ctx(shash)); in rxe_crc32()
/Linux-v6.1/arch/x86/crypto/
Dghash-clmulni-intel_glue.c26 void clmul_ghash_mul(char *dst, const u128 *shash);
29 const u128 *shash);
36 u128 shash; member
67 ctx->shash.a = (b << 1) | (a >> 63); in ghash_setkey()
68 ctx->shash.b = (a << 1) | (b >> 63); in ghash_setkey()
71 ctx->shash.b ^= ((u64)0xc2) << 56; in ghash_setkey()
95 clmul_ghash_mul(dst, &ctx->shash); in ghash_update()
98 clmul_ghash_update(dst, src, srclen, &ctx->shash); in ghash_update()
123 clmul_ghash_mul(dst, &ctx->shash); in ghash_flush()
/Linux-v6.1/drivers/nvme/common/
Dauth.c236 struct shash_desc *shash; in nvme_auth_transform_key() local
258 shash = kmalloc(sizeof(struct shash_desc) + in nvme_auth_transform_key()
261 if (!shash) { in nvme_auth_transform_key()
272 shash->tfm = key_tfm; in nvme_auth_transform_key()
276 ret = crypto_shash_init(shash); in nvme_auth_transform_key()
279 ret = crypto_shash_update(shash, nqn, strlen(nqn)); in nvme_auth_transform_key()
282 ret = crypto_shash_update(shash, "NVMe-over-Fabrics", 17); in nvme_auth_transform_key()
285 ret = crypto_shash_final(shash, transformed_key); in nvme_auth_transform_key()
289 kfree(shash); in nvme_auth_transform_key()
297 kfree(shash); in nvme_auth_transform_key()
/Linux-v6.1/drivers/nvme/host/
Dauth.c427 SHASH_DESC_ON_STACK(shash, chap->shash_tfm); in nvme_auth_dhchap_setup_host_response()
470 shash->tfm = chap->shash_tfm; in nvme_auth_dhchap_setup_host_response()
471 ret = crypto_shash_init(shash); in nvme_auth_dhchap_setup_host_response()
474 ret = crypto_shash_update(shash, challenge, chap->hash_len); in nvme_auth_dhchap_setup_host_response()
478 ret = crypto_shash_update(shash, buf, 4); in nvme_auth_dhchap_setup_host_response()
482 ret = crypto_shash_update(shash, buf, 2); in nvme_auth_dhchap_setup_host_response()
486 ret = crypto_shash_update(shash, buf, 1); in nvme_auth_dhchap_setup_host_response()
489 ret = crypto_shash_update(shash, "HostHost", 8); in nvme_auth_dhchap_setup_host_response()
492 ret = crypto_shash_update(shash, ctrl->opts->host->nqn, in nvme_auth_dhchap_setup_host_response()
496 ret = crypto_shash_update(shash, buf, 1); in nvme_auth_dhchap_setup_host_response()
[all …]
/Linux-v6.1/security/keys/trusted-keys/
Dtrusted_tpm1.c31 struct shash_desc shash; member
47 sdesc->shash.tfm = alg; in init_sdesc()
63 ret = crypto_shash_digest(&sdesc->shash, data, datalen, digest); in TSS_sha1()
86 ret = crypto_shash_init(&sdesc->shash); in TSS_rawhmac()
100 ret = crypto_shash_update(&sdesc->shash, data, dlen); in TSS_rawhmac()
106 ret = crypto_shash_final(&sdesc->shash, digest); in TSS_rawhmac()
137 ret = crypto_shash_init(&sdesc->shash); in TSS_authhmac()
150 ret = crypto_shash_update(&sdesc->shash, data, dlen); in TSS_authhmac()
156 ret = crypto_shash_final(&sdesc->shash, paramdigest); in TSS_authhmac()
211 ret = crypto_shash_init(&sdesc->shash); in TSS_checkhmac1()
[all …]
/Linux-v6.1/tools/perf/util/
Dfncache.c19 unsigned shash(const unsigned char *s) in shash() function
29 int h = shash((const unsigned char *)name) % FNHSIZE; in lookup_fncache()
44 int h = shash((const unsigned char *)name) % FNHSIZE; in update_fncache()
/Linux-v6.1/fs/cifs/
Dsmb2transport.c223 struct shash_desc *shash = NULL; in smb2_calc_signature() local
236 rc = cifs_alloc_hash("hmac(sha256)", &shash); in smb2_calc_signature()
243 shash = server->secmech.hmacsha256; in smb2_calc_signature()
246 rc = crypto_shash_setkey(shash->tfm, ses->auth_key.response, in smb2_calc_signature()
255 rc = crypto_shash_init(shash); in smb2_calc_signature()
270 rc = crypto_shash_update(shash, iov[0].iov_base, in smb2_calc_signature()
282 rc = __cifs_calc_signature(&drqst, server, sigptr, shash); in smb2_calc_signature()
288 cifs_free_hash(&shash); in smb2_calc_signature()
543 struct shash_desc *shash = NULL; in smb3_calc_signature() local
554 rc = cifs_alloc_hash("cmac(aes)", &shash); in smb3_calc_signature()
[all …]
/Linux-v6.1/drivers/net/ppp/
Dppp_mppe.c174 struct crypto_shash *shash; in mppe_alloc() local
187 shash = crypto_alloc_shash("sha1", 0, 0); in mppe_alloc()
188 if (IS_ERR(shash)) in mppe_alloc()
192 crypto_shash_descsize(shash), in mppe_alloc()
195 crypto_free_shash(shash); in mppe_alloc()
198 state->sha1->tfm = shash; in mppe_alloc()
200 digestsize = crypto_shash_digestsize(shash); in mppe_alloc()
/Linux-v6.1/drivers/crypto/bcm/
Dutil.c189 struct shash_desc shash; member
233 sdesc->shash.tfm = hash; in do_shash()
243 rc = crypto_shash_init(&sdesc->shash); in do_shash()
248 rc = crypto_shash_update(&sdesc->shash, data1, data1_len); in do_shash()
254 rc = crypto_shash_update(&sdesc->shash, data2, data2_len); in do_shash()
260 rc = crypto_shash_final(&sdesc->shash, result); in do_shash()
/Linux-v6.1/drivers/thunderbolt/
Ddomain.c707 struct shash_desc *shash; in tb_domain_challenge_switch_key() local
731 shash = kzalloc(sizeof(*shash) + crypto_shash_descsize(tfm), in tb_domain_challenge_switch_key()
733 if (!shash) { in tb_domain_challenge_switch_key()
738 shash->tfm = tfm; in tb_domain_challenge_switch_key()
741 ret = crypto_shash_digest(shash, challenge, sizeof(hmac), hmac); in tb_domain_challenge_switch_key()
752 kfree(shash); in tb_domain_challenge_switch_key()
757 kfree(shash); in tb_domain_challenge_switch_key()
/Linux-v6.1/net/bluetooth/
Damp.c131 struct shash_desc *shash; in hmac_sha256() local
149 shash = kzalloc(sizeof(*shash) + crypto_shash_descsize(tfm), in hmac_sha256()
151 if (!shash) { in hmac_sha256()
156 shash->tfm = tfm; in hmac_sha256()
158 ret = crypto_shash_digest(shash, plaintext, psize, output); in hmac_sha256()
160 kfree(shash); in hmac_sha256()
/Linux-v6.1/drivers/crypto/
Dsa2ul.c437 SHASH_DESC_ON_STACK(shash, data->ctx->shash); in sa_prepare_iopads()
438 int block_size = crypto_shash_blocksize(data->ctx->shash); in sa_prepare_iopads()
439 int digest_size = crypto_shash_digestsize(data->ctx->shash); in sa_prepare_iopads()
446 shash->tfm = data->ctx->shash; in sa_prepare_iopads()
450 crypto_shash_init(shash); in sa_prepare_iopads()
451 crypto_shash_update(shash, sha.k_pad, block_size); in sa_prepare_iopads()
452 sa_export_shash(&sha, shash, digest_size, ipad); in sa_prepare_iopads()
456 crypto_shash_init(shash); in sa_prepare_iopads()
457 crypto_shash_update(shash, sha.k_pad, block_size); in sa_prepare_iopads()
459 sa_export_shash(&sha, shash, digest_size, opad); in sa_prepare_iopads()
[all …]
/Linux-v6.1/include/crypto/
Dhash.h165 #define SHASH_DESC_ON_STACK(shash, ctx) \ argument
166 char __##shash##_desc[sizeof(struct shash_desc) + HASH_MAX_DESCSIZE] \
168 struct shash_desc *shash = (struct shash_desc *)__##shash##_desc

123