350 basic cleanup of zkevm opcode circuits#361
Open
ayashunsky wants to merge 2 commits intomasterfrom
Open
Conversation
mizabrik
approved these changes
Mar 17, 2025
| chunks[4 * chunk_idx + 2] * two_32 + chunks[4 * chunk_idx + 3] * two_48; | ||
| } | ||
|
|
||
| // computes 128-bit chunks of r*b + q - a |
Contributor
There was a problem hiding this comment.
Shall we use conventional (?) q*b + r - a?
Comment on lines
+108
to
+115
| static const unsigned int two_15 = 32768; | ||
| static const unsigned int two_16 = 65536; | ||
| static const nil::crypto3::multiprecision::big_uint<64> two_32 = 4294967296; | ||
| static const nil::crypto3::multiprecision::big_uint<64> two_48 = 281474976710656; | ||
| static const nil::crypto3::multiprecision::big_uint<92> two_64 = 0x10000000000000000_big_uint92; | ||
| static const nil::crypto3::multiprecision::big_uint<130> two_128 = 0x100000000000000000000000000000000_big_uint130; | ||
| static const nil::crypto3::multiprecision::big_uint<205> | ||
| two_192 = 0x1000000000000000000000000000000000000000000000000_big_uint205; |
Contributor
There was a problem hiding this comment.
Suggested change
| static const unsigned int two_15 = 32768; | |
| static const unsigned int two_16 = 65536; | |
| static const nil::crypto3::multiprecision::big_uint<64> two_32 = 4294967296; | |
| static const nil::crypto3::multiprecision::big_uint<64> two_48 = 281474976710656; | |
| static const nil::crypto3::multiprecision::big_uint<92> two_64 = 0x10000000000000000_big_uint92; | |
| static const nil::crypto3::multiprecision::big_uint<130> two_128 = 0x100000000000000000000000000000000_big_uint130; | |
| static const nil::crypto3::multiprecision::big_uint<205> | |
| two_192 = 0x1000000000000000000000000000000000000000000000000_big_uint205; | |
| static const uint32_t two_15 = 1 << 15; | |
| static const uint32_t two_16 = 1 << 16; | |
| static const nil::crypto3::multiprecision::big_uint<64> two_32 = 1ull << 32; | |
| static const nil::crypto3::multiprecision::big_uint<64> two_48 = 1ull << 48; | |
| static const nil::crypto3::multiprecision::big_uint<92> two_64 = 1_big_uint92 << 64; | |
| static const nil::crypto3::multiprecision::big_uint<130> two_128 = 1_big_uint130 << 128; | |
| static const nil::crypto3::multiprecision::big_uint<205> two_192 = 1_big_uint205 << 192; |
| two_192 = 0x1000000000000000000000000000000000000000000000000_big_uint205; | ||
|
|
||
| template<typename T, typename V = T> | ||
| T chunk_sum_64(const std::vector<V> &chunks, const unsigned char chunk_idx) { |
Contributor
There was a problem hiding this comment.
I'd rather have it returning a vector with all the chunks, without specifying chunk_idx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moved common power-of-two constants and multiplication-computing functions to util.hpp