Skip to content

Commit

Permalink
squeeze fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jlmucb committed Apr 25, 2024
1 parent 108aa3b commit a605319
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion v2/hash/sha3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ void sha3::finalize() {
bool sha3::squeeze() {
if (!finalized_) return false;
uint64_t zero[rb_ / sizeof(uint64_t)];
memset((byte*)zero, 0, rb_ / sizeof(uint64_t));
memset((byte*)zero, 0, rb_);
transform_block(zero, rb_ / sizeof(uint64_t));
return true;
}
Expand Down
2 changes: 2 additions & 0 deletions v2/kyber/kyber.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,7 @@ bool kyber_keygen(int g, kyber_parameters& p, int* ek_len, byte* ek,
printf("kyber_keygen: xof failed\n");
return false;
}
if (i==0 && j==0) {printf("keygen xof %d\n", b_xof_len); print_bytes(b_xof_len, b_xof); printf("\n");}
if (!sample_ntt(p.q_, p.n_, b_xof_len, b_xof,
A_ntt.c_[A_ntt.index(i, j)]->c_)) {
printf("kyber_keygen: sample_ntt failed\n");
Expand Down Expand Up @@ -1238,6 +1239,7 @@ bool kyber_encrypt(int g, kyber_parameters& p, int ek_len, byte* ek,
printf("kyber_keygen: xof failed\n");
return false;
}
if (i==0 && j==0) {printf("encrypt xof %d\n", b_xof_len); print_bytes(b_xof_len, b_xof); printf("\n");}
if (!sample_ntt(p.q_, p.n_, b_xof_len, b_xof,
A_ntt.c_[A_ntt.index(i, j)]->c_)) {
printf("kyber_keygen: sample_ntt failed\n");
Expand Down

0 comments on commit a605319

Please sign in to comment.