Skip to content

gh-126433: Update hacl-star #126791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions Misc/sbom.spdx.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Modules/_hacl/Hacl_Hash_Blake2b.c
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,8 @@ Hacl_Hash_Blake2b_reset_with_key_and_params(
uint8_t *k
)
{
index_of_state(s);
Hacl_Hash_Blake2b_index i1 = index_of_state(s);
KRML_MAYBE_UNUSED_VAR(i1);
reset_raw(s, ((Hacl_Hash_Blake2b_params_and_key){ .fst = p, .snd = k }));
}

Expand Down
3 changes: 2 additions & 1 deletion Modules/_hacl/Hacl_Hash_Blake2b_Simd256.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,8 @@ Hacl_Hash_Blake2b_Simd256_reset_with_key_and_params(
uint8_t *k
)
{
index_of_state(s);
Hacl_Hash_Blake2b_index i1 = index_of_state(s);
KRML_MAYBE_UNUSED_VAR(i1);
reset_raw(s, ((Hacl_Hash_Blake2b_params_and_key){ .fst = p, .snd = k }));
}

Expand Down
3 changes: 2 additions & 1 deletion Modules/_hacl/Hacl_Hash_Blake2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,8 @@ Hacl_Hash_Blake2s_reset_with_key_and_params(
uint8_t *k
)
{
index_of_state(s);
Hacl_Hash_Blake2b_index i1 = index_of_state(s);
KRML_MAYBE_UNUSED_VAR(i1);
reset_raw(s, ((Hacl_Hash_Blake2b_params_and_key){ .fst = p, .snd = k }));
}

Expand Down
3 changes: 2 additions & 1 deletion Modules/_hacl/Hacl_Hash_Blake2s_Simd128.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,8 @@ Hacl_Hash_Blake2s_Simd128_reset_with_key_and_params(
uint8_t *k
)
{
index_of_state(s);
Hacl_Hash_Blake2b_index i1 = index_of_state(s);
KRML_MAYBE_UNUSED_VAR(i1);
reset_raw(s, ((Hacl_Hash_Blake2b_params_and_key){ .fst = p, .snd = k }));
}

Expand Down
6 changes: 3 additions & 3 deletions Modules/_hacl/Hacl_Hash_SHA2.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void Hacl_Hash_SHA2_sha224_init(uint32_t *hash)
os[i] = x;);
}

static inline void sha224_update_nblocks(uint32_t len, uint8_t *b, uint32_t *st)
void Hacl_Hash_SHA2_sha224_update_nblocks(uint32_t len, uint8_t *b, uint32_t *st)
{
Hacl_Hash_SHA2_sha256_update_nblocks(len, b, st);
}
Expand Down Expand Up @@ -825,7 +825,7 @@ void Hacl_Hash_SHA2_digest_224(Hacl_Streaming_MD_state_32 *state, uint8_t *outpu
}
uint8_t *buf_last = buf_1 + r - ite;
uint8_t *buf_multi = buf_1;
sha224_update_nblocks(0U, buf_multi, tmp_block_state);
Hacl_Hash_SHA2_sha224_update_nblocks(0U, buf_multi, tmp_block_state);
uint64_t prev_len_last = total_len - (uint64_t)r;
Hacl_Hash_SHA2_sha224_update_last(prev_len_last + (uint64_t)r, r, buf_last, tmp_block_state);
Hacl_Hash_SHA2_sha224_finish(tmp_block_state, output);
Expand All @@ -847,7 +847,7 @@ void Hacl_Hash_SHA2_hash_224(uint8_t *output, uint8_t *input, uint32_t input_len
Hacl_Hash_SHA2_sha224_init(st);
uint32_t rem = input_len % 64U;
uint64_t len_ = (uint64_t)input_len;
sha224_update_nblocks(input_len, ib, st);
Hacl_Hash_SHA2_sha224_update_nblocks(input_len, ib, st);
uint32_t rem1 = input_len % 64U;
uint8_t *b0 = ib;
uint8_t *lb = b0 + input_len - rem1;
Expand Down
3 changes: 2 additions & 1 deletion Modules/_hacl/Hacl_Hash_SHA3.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ Hacl_Hash_SHA3_update_multi_sha3(
uint8_t *bl0 = b_;
uint8_t *uu____0 = b0 + i * block_len(a);
memcpy(bl0, uu____0, block_len(a) * sizeof (uint8_t));
block_len(a);
uint32_t unused = block_len(a);
KRML_MAYBE_UNUSED_VAR(unused);
absorb_inner_32(b_, s);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/_hacl/Lib_Memzero0.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void Lib_Memzero0_memzero0(void *dst, uint64_t len) {
size_t len_ = (size_t) len;

#ifdef _WIN32
SecureZeroMemory(dst, len);
SecureZeroMemory(dst, len_);
#elif defined(__APPLE__) && defined(__MACH__)
memset_s(dst, len_, 0, len_);
#elif (defined(__linux__) && !defined(LINUX_NO_EXPLICIT_BZERO)) || defined(__FreeBSD__)
Expand Down
2 changes: 2 additions & 0 deletions Modules/_hacl/internal/Hacl_Hash_SHA2.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ void Hacl_Hash_SHA2_sha256_finish(uint32_t *st, uint8_t *h);

void Hacl_Hash_SHA2_sha224_init(uint32_t *hash);

void Hacl_Hash_SHA2_sha224_update_nblocks(uint32_t len, uint8_t *b, uint32_t *st);

void
Hacl_Hash_SHA2_sha224_update_last(uint64_t totlen, uint32_t len, uint8_t *b, uint32_t *st);

Expand Down
2 changes: 1 addition & 1 deletion Modules/_hacl/refresh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fi

# Update this when updating to a new version after verifying that the changes
# the update brings in are good.
expected_hacl_star_rev=315a9e491d2bc347b9dae99e0ea506995ea84d9d
expected_hacl_star_rev=f218923ef2417d963d7efc7951593ae6aef613f7

hacl_dir="$(realpath "$1")"
cd "$(dirname "$0")"
Expand Down
Loading