Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: reduce number of gates in stdlib/sha256 hash function (#8905)
We can reduce number of gates for round variables a and e in sha256. At the start of the round variables a and e were converted in maj and ch form respectively. But after that their .sparse form was replaced in functions majority and choose with the same values, and this procedure added some unnecessary gates. We can fix this by just initializing a and e using default constructors and put in .normal part values of h_init[0] and h_init[4]. After that functions majority and choose will add in .sparse values of lookup automatically All tests for stdlib/sha256 have passed after this patch. As a result, number of gates from sha256_nist_vector_five were reduced from 65194 to 65104. --------- Co-authored-by: Rumata888 <isennovskiy@gmail.com>
- Loading branch information