-
Notifications
You must be signed in to change notification settings - Fork 9
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
Getting rid of unbounded shift #241
base: master
Are you sure you want to change the base?
Conversation
fec1077
to
b90241c
Compare
Gcc Test Results 162 files - 1 162 suites - 1 16m 25s ⏱️ +8s For more details on these failures, see this check. Results for commit b90241c. ± Comparison against base commit 1fed3a7. This pull request removes 5 and adds 8 tests. Note that renamed tests count towards both.
|
d09d2bf
to
79d8a26
Compare
has_encode<T>::value && has_decode<T>::value; | ||
typedef T type; | ||
}; | ||
//template<typename T> |
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.
Is this intentional? Should we remove the total block?
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.
Deleted this code.
k = k + data[i] * (shft % L); | ||
shft *= 0x10000000000000000_big_uint512; | ||
k = k + data[i] * shft; | ||
shft = wrapping_mul(shft, 0x10000000000000000_big_uint512) % L; |
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 think we can keep original code, just skip *=
on the last step.
Why don't we use shift <<= 64;
here in first place?
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.
We want modulo L here, not modulo 0x10000000000000000_big_uint512, no?
fc050e2
to
b25cd40
Compare
… access bugs. We should not shift over the size of values and hide it with this class.
b25cd40
to
321188a
Compare
Getting rid of unbounded shift. It looked nice, but introduced memory access bugs. We should not shift over the size of values and hide it with this class.