-
Notifications
You must be signed in to change notification settings - Fork 14
350 basic cleanup of zkevm opcode circuits #361
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
base: master
Are you sure you want to change the base?
Conversation
chunks[4 * chunk_idx + 2] * two_32 + chunks[4 * chunk_idx + 3] * two_48; | ||
} | ||
|
||
// computes 128-bit chunks of r*b + q - a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we use conventional (?) q*b + r - a?
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, why not uint64_t
?
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather have it returning a vector with all the chunks, without specifying chunk_idx
Moved common power-of-two constants and multiplication-computing functions to util.hpp