/linux/crypto/ |
A D | shash.c | 79 err = shash->setkey(tfm, key, keylen); in crypto_shash_setkey() 82 shash_set_needkey(tfm, shash); in crypto_shash_setkey() 131 return shash->update(desc, data, len); in crypto_shash_update() 152 err = shash->final(desc, buf); in shash_final_unaligned() 172 return shash->final(desc, out); in crypto_shash_final() 193 return shash->finup(desc, data, len, out); in crypto_shash_finup() 383 struct crypto_shash *shash; in crypto_init_shash_ops_async() local 389 if (IS_ERR(shash)) { in crypto_init_shash_ops_async() 391 return PTR_ERR(shash); in crypto_init_shash_ops_async() 394 *ctx = shash; in crypto_init_shash_ops_async() [all …]
|
A D | hmac.c | 51 SHASH_DESC_ON_STACK(shash, hash); in hmac_setkey() 54 shash->tfm = hash; in hmac_setkey() 59 err = crypto_shash_digest(shash, inkey, keylen, ipad); in hmac_setkey() 75 return crypto_shash_init(shash) ?: in hmac_setkey() 76 crypto_shash_update(shash, ipad, bs) ?: in hmac_setkey() 77 crypto_shash_export(shash, ipad) ?: in hmac_setkey() 78 crypto_shash_init(shash) ?: in hmac_setkey() 79 crypto_shash_update(shash, opad, bs) ?: in hmac_setkey() 80 crypto_shash_export(shash, opad); in hmac_setkey()
|
/linux/fs/ksmbd/ |
A D | crypto_ctx.c | 31 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/drivers/crypto/vmx/ |
A D | ghash.c | 40 u64 shash[2]; member 50 memset(dctx->shash, 0, GHASH_DIGEST_SIZE); in p8_ghash_init() 82 gcm_ghash_p8(dctx->shash, ctx->htable, in __ghash_block() 88 crypto_xor((u8 *)dctx->shash, dctx->buffer, GHASH_BLOCK_SIZE); in __ghash_block() 89 gf128mul_lle((be128 *)dctx->shash, &ctx->key); in __ghash_block() 101 gcm_ghash_p8(dctx->shash, ctx->htable, in __ghash_blocks() 108 crypto_xor((u8 *)dctx->shash, src, GHASH_BLOCK_SIZE); in __ghash_blocks() 109 gf128mul_lle((be128 *)dctx->shash, &ctx->key); in __ghash_blocks() 164 memcpy(out, dctx->shash, GHASH_DIGEST_SIZE); in p8_ghash_final()
|
/linux/fs/cifs/ |
A D | smb2transport.c | 217 struct shash_desc *shash; in smb2_calc_signature() local 238 shash = &sdesc->shash; in smb2_calc_signature() 241 shash = &server->secmech.sdeschmacsha256->shash; in smb2_calc_signature() 253 rc = crypto_shash_init(shash); in smb2_calc_signature() 268 rc = crypto_shash_update(shash, iov[0].iov_base, in smb2_calc_signature() 280 rc = __cifs_calc_signature(&drqst, server, sigptr, shash); in smb2_calc_signature() 537 struct shash_desc *shash; in smb3_calc_signature() local 552 shash = &sdesc->shash; in smb3_calc_signature() 555 shash = &server->secmech.sdesccmacaes->shash; in smb3_calc_signature() 572 rc = crypto_shash_init(shash); in smb3_calc_signature() [all …]
|
A D | cifsencrypt.c | 29 struct shash_desc *shash) in __cifs_calc_signature() argument 56 rc = crypto_shash_update(shash, in __cifs_calc_signature() 74 rc = crypto_shash_update(shash, kaddr, len); in __cifs_calc_signature() 85 rc = crypto_shash_final(shash, signature); in __cifs_calc_signature() 112 rc = crypto_shash_init(&server->secmech.sdescmd5->shash); in cifs_calc_signature() 118 rc = crypto_shash_update(&server->secmech.sdescmd5->shash, in cifs_calc_signature() 126 &server->secmech.sdescmd5->shash); in cifs_calc_signature() 427 rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash); in calc_ntlmv2_hash() 468 crypto_shash_update(&ses->server->secmech.sdeschmacmd5->shash, in calc_ntlmv2_hash() 488 crypto_shash_update(&ses->server->secmech.sdeschmacmd5->shash, in calc_ntlmv2_hash() [all …]
|
A D | misc.c | 1078 struct crypto_shash **shash, struct sdesc **sdesc) in cifs_alloc_hash() argument 1086 *shash = crypto_alloc_shash(name, 0, 0); in cifs_alloc_hash() 1087 if (IS_ERR(*shash)) { in cifs_alloc_hash() 1089 rc = PTR_ERR(*shash); in cifs_alloc_hash() 1090 *shash = NULL; in cifs_alloc_hash() 1099 crypto_free_shash(*shash); in cifs_alloc_hash() 1100 *shash = NULL; in cifs_alloc_hash() 1104 (*sdesc)->shash.tfm = *shash; in cifs_alloc_hash() 1120 if (*shash) in cifs_free_hash() 1121 crypto_free_shash(*shash); in cifs_free_hash() [all …]
|
/linux/security/integrity/ima/ |
A D | ima_crypto.c | 462 SHASH_DESC_ON_STACK(shash, tfm); in ima_calc_file_hash_tfm() 464 shash->tfm = tfm; in ima_calc_file_hash_tfm() 468 rc = crypto_shash_init(shash); in ima_calc_file_hash_tfm() 593 rc = crypto_shash_init(shash); in ima_calc_field_array_hash_tfm() 605 rc = crypto_shash_update(shash, in ima_calc_field_array_hash_tfm() 723 SHASH_DESC_ON_STACK(shash, tfm); in calc_buffer_shash_tfm() 727 shash->tfm = tfm; in calc_buffer_shash_tfm() 731 rc = crypto_shash_init(shash); in calc_buffer_shash_tfm() 805 SHASH_DESC_ON_STACK(shash, tfm); in ima_calc_boot_aggregate_tfm() 807 shash->tfm = tfm; in ima_calc_boot_aggregate_tfm() [all …]
|
/linux/net/ipv6/ |
A D | seg6_hmac.c | 123 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 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() 422 struct shash_desc *shash; in seg6_hmac_exit() local 424 shash = *per_cpu_ptr(algo->shashs, cpu); in seg6_hmac_exit() [all …]
|
/linux/fs/ubifs/ |
A D | auth.c | 391 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/lib/ |
A D | libcrc32c.c | 40 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()
|
A D | digsig.c | 28 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()
|
A D | crc-t10dif.c | 66 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()
|
/linux/arch/x86/crypto/ |
A D | ghash-clmulni-intel_glue.c | 26 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/drivers/infiniband/sw/rxe/ |
A D | rxe_icrc.c | 48 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/security/keys/trusted-keys/ |
A D | trusted_tpm1.c | 31 struct shash_desc shash; member 47 sdesc->shash.tfm = alg; in init_sdesc() 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() 234 ret = crypto_shash_final(&sdesc->shash, paramdigest); in TSS_checkhmac1() [all …]
|
/linux/tools/perf/util/ |
A D | fncache.c | 19 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/drivers/net/ppp/ |
A D | ppp_mppe.c | 174 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/security/keys/ |
A D | dh.c | 83 struct shash_desc shash; member 110 sdesc->shash.tfm = tfm; in kdf_alloc() 126 if (sdesc->shash.tfm) in kdf_dealloc() 127 crypto_free_shash(sdesc->shash.tfm); in kdf_dealloc() 146 struct shash_desc *desc = &sdesc->shash; in kdf_ctr() 206 crypto_shash_digestsize(sdesc->shash.tfm)); in keyctl_dh_compute_kdf()
|
/linux/drivers/crypto/bcm/ |
A D | util.c | 189 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/drivers/thunderbolt/ |
A D | domain.c | 715 struct shash_desc *shash; in tb_domain_challenge_switch_key() local 739 shash = kzalloc(sizeof(*shash) + crypto_shash_descsize(tfm), in tb_domain_challenge_switch_key() 741 if (!shash) { in tb_domain_challenge_switch_key() 746 shash->tfm = tfm; in tb_domain_challenge_switch_key() 749 ret = crypto_shash_digest(shash, challenge, sizeof(hmac), hmac); in tb_domain_challenge_switch_key() 760 kfree(shash); in tb_domain_challenge_switch_key() 765 kfree(shash); in tb_domain_challenge_switch_key()
|
/linux/net/bluetooth/ |
A D | amp.c | 131 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/drivers/crypto/ |
A D | sa2ul.c | 437 SHASH_DESC_ON_STACK(shash, 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() 456 crypto_shash_init(shash); in sa_prepare_iopads() 1453 int bs = crypto_shash_blocksize(ctx->shash); in sa_sha_setup() 1506 if (IS_ERR(ctx->shash)) { in sa_sha_cra_init_alg() 1509 return PTR_ERR(ctx->shash); in sa_sha_cra_init_alg() 1686 crypto_free_shash(ctx->shash); in sa_sha_cra_exit() 1740 if (IS_ERR(ctx->shash)) { in sa_cra_init_aead() 1742 return PTR_ERR(ctx->shash); in sa_cra_init_aead() [all …]
|
A D | omap-sham.c | 165 struct crypto_shash *shash; member 1104 int bs = crypto_shash_blocksize(bctx->shash); in omap_sham_finish_hmac() 1105 int ds = crypto_shash_digestsize(bctx->shash); in omap_sham_finish_hmac() 1106 SHASH_DESC_ON_STACK(shash, bctx->shash); in omap_sham_finish_hmac() 1108 shash->tfm = bctx->shash; in omap_sham_finish_hmac() 1110 return crypto_shash_init(shash) ?: in omap_sham_finish_hmac() 1289 int bs = crypto_shash_blocksize(bctx->shash); in omap_sham_setkey() 1290 int ds = crypto_shash_digestsize(bctx->shash); in omap_sham_setkey() 1343 if (IS_ERR(bctx->shash)) { in omap_sham_cra_init_alg() 1347 return PTR_ERR(bctx->shash); in omap_sham_cra_init_alg() [all …]
|
/linux/include/crypto/ |
A D | hash.h | 165 #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
|