-
Notifications
You must be signed in to change notification settings - Fork 270
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
Add Fp64
#141
Conversation
let subtractor = (2 * ($limbs - 1usize)) | ||
.checked_sub(i + 1) | ||
.map(|index| r[index]) | ||
.unwrap_or(0); |
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.
Required to avoid underflowing. I have confirmed locally that it doesn't affect performance.
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.
Can a comment be added for the arithmetic operations these lines are doing / intending to do? (Looks like propagating a carry bit?)
I agree this matches what was previously implemented.
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'm not too sure myself, but I added a comment explaining what is computed.
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.
Ok cool!
Kinda worrisome if neither of us understand the code, we should file an issue to decipher & document whats going on in this function 😅
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.
Agreed, @jon-chuang should have the best state, I believe?
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.
LGTM, left a couple of requests for additional comments, then I think its good to merge
@@ -22,7 +23,7 @@ macro_rules! impl_field_mul_assign { | |||
#[cfg(use_asm)] | |||
#[allow(unsafe_code, unused_mut)] | |||
{ | |||
if $limbs <= 6 { | |||
if $limbs <= 6 && $limbs > 1 { |
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.
Not related to this PR, but could there be a comment for why theres a different method for limbs > 6? Is it just that the larger limb size case isn't implemented? (Doesn't need to block this PR)
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.
Yes, larger limb size is not implemented
let subtractor = (2 * ($limbs - 1usize)) | ||
.checked_sub(i + 1) | ||
.map(|index| r[index]) | ||
.unwrap_or(0); |
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.
Can a comment be added for the arithmetic operations these lines are doing / intending to do? (Looks like propagating a carry bit?)
I agree this matches what was previously implemented.
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.
LGTM
This passes tests locally for the prime 257. |
Description
Adds
Fp64
.Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
Pending
section inCHANGELOG.md
Files changed
in the Github PR explorer