Skip to content

Commit

Permalink
fix(halo2_proof); fix wrong use of kSha256StateLength
Browse files Browse the repository at this point in the history
  • Loading branch information
dongchangYoo committed Mar 25, 2024
1 parent 4f71fab commit 98c86cb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions halo2_proofs/src/bn254_sha256_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ void Sha256Writer::finalize(std::array<uint8_t, kSha256DigestLength>& result) {
}

rust::Vec<uint8_t> Sha256Writer::state() const {
constexpr size_t kStateSize = sizeof(kSha256StateLength);
rust::Vec<uint8_t> ret;
// NOTE(chokobole): |rust::Vec<uint8_t>| doesn't have |resize()|.
ret.reserve(kStateSize);
for (size_t i = 0; i < kStateSize; ++i) {
ret.reserve(kSha256StateLength);
for (size_t i = 0; i < kSha256StateLength; ++i) {
ret.push_back(0);
}
size_t state_size;
Expand Down

0 comments on commit 98c86cb

Please sign in to comment.