From 98c86cb0d992a45c2a439b5171f1168e48e52a87 Mon Sep 17 00:00:00 2001 From: dongchangYoo Date: Mon, 25 Mar 2024 17:09:08 +0900 Subject: [PATCH] fix(halo2_proof); fix wrong use of `kSha256StateLength` --- halo2_proofs/src/bn254_sha256_writer.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/halo2_proofs/src/bn254_sha256_writer.cc b/halo2_proofs/src/bn254_sha256_writer.cc index 1b494484..5dd98888 100644 --- a/halo2_proofs/src/bn254_sha256_writer.cc +++ b/halo2_proofs/src/bn254_sha256_writer.cc @@ -25,11 +25,10 @@ void Sha256Writer::finalize(std::array& result) { } rust::Vec Sha256Writer::state() const { - constexpr size_t kStateSize = sizeof(kSha256StateLength); rust::Vec ret; // NOTE(chokobole): |rust::Vec| 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;