Skip to content
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

chore: reduce number of gates in stdlib/sha256 hash function #8905

Merged
merged 3 commits into from
Oct 2, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,16 @@ std::array<field_t<Builder>, 8> sha256_block(const std::array<field_t<Builder>,
/**
* Initialize round variables with previous block output
**/
auto a = map_into_maj_sparse_form(h_init[0]);
/**
* We can initialize round variables a and c and put value h_init[0] and
* h_init[4] in .normal, and don't do lookup for maj_output, because majority and choose
* functions will do that in the next step
**/
sparse_value<Builder> a = sparse_value<Builder>(h_init[0]);
auto b = map_into_maj_sparse_form(h_init[1]);
auto c = map_into_maj_sparse_form(h_init[2]);
auto d = map_into_maj_sparse_form(h_init[3]);
auto e = map_into_choose_sparse_form(h_init[4]);
sparse_value<Builder> e = sparse_value<Builder>(h_init[4]);
auto f = map_into_choose_sparse_form(h_init[5]);
auto g = map_into_choose_sparse_form(h_init[6]);
auto h = map_into_choose_sparse_form(h_init[7]);
Expand Down
Loading