diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
commit | fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch) | |
tree | 4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /security/nss/lib/freebl/Hacl_Hash_SHA2_shim.h | |
parent | Releasing progress-linux version 124.0.1-1~progress7.99u1. (diff) | |
download | firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'security/nss/lib/freebl/Hacl_Hash_SHA2_shim.h')
-rw-r--r-- | security/nss/lib/freebl/Hacl_Hash_SHA2_shim.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/security/nss/lib/freebl/Hacl_Hash_SHA2_shim.h b/security/nss/lib/freebl/Hacl_Hash_SHA2_shim.h new file mode 100644 index 0000000000..8e510e914d --- /dev/null +++ b/security/nss/lib/freebl/Hacl_Hash_SHA2_shim.h @@ -0,0 +1,38 @@ +#include "blapi.h" +#include "../pqg.h" + +static inline void +sha512_pre_msg(uint8_t *hash, uint8_t *prefix, uint32_t len, uint8_t *input) +{ + SHA512Context *ctx = SHA512_NewContext(); + uint32_t l = SHA512_LENGTH; + SHA512_Begin(ctx); + SHA512_Update(ctx, prefix, 32); + SHA512_Update(ctx, input, len); + SHA512_End(ctx, hash, &l, SHA512_LENGTH); + SHA512_DestroyContext(ctx, PR_TRUE); +} + +static inline void +sha512_pre_pre2_msg( + uint8_t *hash, + uint8_t *prefix, + uint8_t *prefix2, + uint32_t len, + uint8_t *input) +{ + SHA512Context *ctx = SHA512_NewContext(); + uint32_t l = SHA512_LENGTH; + SHA512_Begin(ctx); + SHA512_Update(ctx, prefix, 32); + SHA512_Update(ctx, prefix2, 32); + SHA512_Update(ctx, input, len); + SHA512_End(ctx, hash, &l, SHA512_LENGTH); + SHA512_DestroyContext(ctx, PR_TRUE); +} + +static void +Hacl_Streaming_SHA2_hash_512(uint8_t *secret, uint32_t len, uint8_t *expanded) +{ + SHA512_HashBuf(expanded, secret, len); +}
\ No newline at end of file |