Home
last modified time | relevance | path

Searched refs:sha_ctx (Results 1 – 10 of 10) sorted by relevance

/linux/lib/crypto/
H A Dsha512.c305 __sha512_init(&ctx->sha_ctx, &key->istate, SHA512_BLOCK_SIZE); in __hmac_sha512_init()
313 __hmac_sha512_preparekey(&ctx->ctx.sha_ctx.state, &ctx->ctx.ostate, in hmac_sha384_init_usingrawkey()
315 ctx->ctx.sha_ctx.bytecount_lo = SHA512_BLOCK_SIZE; in hmac_sha384_init_usingrawkey()
316 ctx->ctx.sha_ctx.bytecount_hi = 0; in hmac_sha384_init_usingrawkey()
323 __hmac_sha512_preparekey(&ctx->ctx.sha_ctx.state, &ctx->ctx.ostate, in hmac_sha512_init_usingrawkey()
325 ctx->ctx.sha_ctx.bytecount_lo = SHA512_BLOCK_SIZE; in hmac_sha512_init_usingrawkey()
326 ctx->ctx.sha_ctx.bytecount_hi = 0; in hmac_sha512_init_usingrawkey()
334 __sha512_final(&ctx->sha_ctx, ctx->sha_ctx.buf, digest_size); in __hmac_sha512_final()
335 memset(&ctx->sha_ctx.buf[digest_size], 0, in __hmac_sha512_final()
337 ctx->sha_ctx.buf[digest_size] = 0x80; in __hmac_sha512_final()
[all …]
H A Dsha256.c380 __sha256_init(&ctx->sha_ctx, &key->istate, SHA256_BLOCK_SIZE); in __hmac_sha256_init()
388 __hmac_sha256_preparekey(&ctx->ctx.sha_ctx.state, &ctx->ctx.ostate, in hmac_sha224_init_usingrawkey()
390 ctx->ctx.sha_ctx.bytecount = SHA256_BLOCK_SIZE; in hmac_sha224_init_usingrawkey()
397 __hmac_sha256_preparekey(&ctx->ctx.sha_ctx.state, &ctx->ctx.ostate, in hmac_sha256_init_usingrawkey()
399 ctx->ctx.sha_ctx.bytecount = SHA256_BLOCK_SIZE; in hmac_sha256_init_usingrawkey()
407 __sha256_final(&ctx->sha_ctx, ctx->sha_ctx.buf, digest_size); in __hmac_sha256_final()
408 memset(&ctx->sha_ctx.buf[digest_size], 0, in __hmac_sha256_final()
410 ctx->sha_ctx.buf[digest_size] = 0x80; in __hmac_sha256_final()
411 *(__be32 *)&ctx->sha_ctx.buf[SHA256_BLOCK_SIZE - 4] = in __hmac_sha256_final()
415 sha256_blocks(&ctx->ostate, ctx->sha_ctx.buf, 1); in __hmac_sha256_final()
/linux/security/keys/trusted-keys/
H A Dtrusted_tpm1.c133 struct sha1_ctx sha_ctx; in TSS_authhmac() local
144 sha1_init(&sha_ctx); in TSS_authhmac()
155 sha1_update(&sha_ctx, data, dlen); in TSS_authhmac()
159 sha1_final(&sha_ctx, paramdigest); in TSS_authhmac()
185 struct sha1_ctx sha_ctx; in TSS_checkhmac1() local
206 sha1_init(&sha_ctx); in TSS_checkhmac1()
207 sha1_update(&sha_ctx, (const u8 *)&result, sizeof(result)); in TSS_checkhmac1()
208 sha1_update(&sha_ctx, (const u8 *)&ordinal, sizeof(ordinal)); in TSS_checkhmac1()
215 sha1_update(&sha_ctx, buffer + dpos, dlen); in TSS_checkhmac1()
218 sha1_final(&sha_ctx, paramdigest); in TSS_checkhmac1()
[all …]
/linux/crypto/
H A Dsha256.c223 return __crypto_sha256_export(&HMAC_SHA224_CTX(desc)->ctx.sha_ctx, out); in crypto_hmac_sha224_export()
231 return __crypto_sha256_import(&ctx->ctx.sha_ctx, in); in crypto_hmac_sha224_import()
236 return __crypto_sha256_export_core(&HMAC_SHA224_CTX(desc)->ctx.sha_ctx, in crypto_hmac_sha224_export_core()
246 return __crypto_sha256_import_core(&ctx->ctx.sha_ctx, in); in crypto_hmac_sha224_import_core()
290 return __crypto_sha256_export(&HMAC_SHA256_CTX(desc)->ctx.sha_ctx, out); in crypto_hmac_sha256_export()
298 return __crypto_sha256_import(&ctx->ctx.sha_ctx, in); in crypto_hmac_sha256_import()
303 return __crypto_sha256_export_core(&HMAC_SHA256_CTX(desc)->ctx.sha_ctx, in crypto_hmac_sha256_export_core()
313 return __crypto_sha256_import_core(&ctx->ctx.sha_ctx, in); in crypto_hmac_sha256_import_core()
H A Dsha512.c229 return __crypto_sha512_export(&HMAC_SHA384_CTX(desc)->ctx.sha_ctx, out); in crypto_hmac_sha384_export()
237 return __crypto_sha512_import(&ctx->ctx.sha_ctx, in); in crypto_hmac_sha384_import()
242 return __crypto_sha512_export_core(&HMAC_SHA384_CTX(desc)->ctx.sha_ctx, in crypto_hmac_sha384_export_core()
252 return __crypto_sha512_import_core(&ctx->ctx.sha_ctx, in); in crypto_hmac_sha384_import_core()
296 return __crypto_sha512_export(&HMAC_SHA512_CTX(desc)->ctx.sha_ctx, out); in crypto_hmac_sha512_export()
304 return __crypto_sha512_import(&ctx->ctx.sha_ctx, in); in crypto_hmac_sha512_import()
309 return __crypto_sha512_export_core(&HMAC_SHA512_CTX(desc)->ctx.sha_ctx, in crypto_hmac_sha512_export_core()
319 return __crypto_sha512_import_core(&ctx->ctx.sha_ctx, in); in crypto_hmac_sha512_import_core()
H A Dsha1.c157 return __crypto_sha1_export(&HMAC_SHA1_CTX(desc)->sha_ctx, out); in crypto_hmac_sha1_export()
165 return __crypto_sha1_import(&ctx->sha_ctx, in); in crypto_hmac_sha1_import()
170 return __crypto_sha1_export_core(&HMAC_SHA1_CTX(desc)->sha_ctx, out); in crypto_hmac_sha1_export_core()
178 return __crypto_sha1_import_core(&ctx->sha_ctx, in); in crypto_hmac_sha1_import_core()
/linux/include/crypto/
H A Dsha2.h144 struct __sha256_ctx sha_ctx; member
278 __sha256_update(&ctx->ctx.sha_ctx, data, data_len); in hmac_sha224_update()
482 __sha256_update(&ctx->ctx.sha_ctx, data, data_len); in hmac_sha256_update()
557 struct __sha512_ctx sha_ctx; member
691 __sha512_update(&ctx->ctx.sha_ctx, data, data_len); in hmac_sha384_update()
866 __sha512_update(&ctx->ctx.sha_ctx, data, data_len); in hmac_sha512_update()
/linux/fs/smb/client/
H A Dsmb2misc.c890 struct sha512_ctx sha_ctx; in smb311_update_preauth_hash()
916 sha512_init(&sha_ctx); in smb311_update_preauth_hash()
917 sha512_update(&sha_ctx, ses->preauth_sha_hash, SMB2_PREAUTH_HASH_SIZE); in smb311_update_preauth_hash()
919 sha512_update(&sha_ctx, iov[i].iov_base, iov[i].iov_len); in smb311_update_preauth_hash()
920 sha512_final(&sha_ctx, ses->preauth_sha_hash); in smb311_update_preauth_hash()
889 struct sha512_ctx sha_ctx; smb311_update_preauth_hash() local
/linux/fs/smb/server/
H A Dauth.c679 struct sha512_ctx sha_ctx; in ksmbd_gen_preauth_integrity_hash() local
685 sha512_init(&sha_ctx); in ksmbd_gen_preauth_integrity_hash()
686 sha512_update(&sha_ctx, pi_hash, 64); in ksmbd_gen_preauth_integrity_hash()
687 sha512_update(&sha_ctx, all_bytes_msg, msg_size); in ksmbd_gen_preauth_integrity_hash()
688 sha512_final(&sha_ctx, pi_hash); in ksmbd_gen_preauth_integrity_hash()
/linux/net/ipv6/
H A Daddrconf.c3342 static struct sha1_ctx sha_ctx; in ipv6_generate_stable_address() local
3370 sha1_init(&sha_ctx); in ipv6_generate_stable_address()
3379 sha1_update(&sha_ctx, data.__data, sizeof(data)); in ipv6_generate_stable_address()
3388 temp.s6_addr32[2] = (__force __be32)sha_ctx.state.h[0]; in ipv6_generate_stable_address()
3389 temp.s6_addr32[3] = (__force __be32)sha_ctx.state.h[1]; in ipv6_generate_stable_address()