Conversation
| let subtractor = (2 * ($limbs - 1usize)) | ||
| .checked_sub(i + 1) | ||
| .map(|index| r[index]) | ||
| .unwrap_or(0); |
There was a problem hiding this comment.
Required to avoid underflowing. I have confirmed locally that it doesn't affect performance.
There was a problem hiding this comment.
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.
I'm not too sure myself, but I added a comment explaining what is computed.
There was a problem hiding this comment.
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.
Agreed, @jon-chuang should have the best state, I believe?
| #[allow(unsafe_code, unused_mut)] | ||
| { | ||
| if $limbs <= 6 { | ||
| if $limbs <= 6 && $limbs > 1 { |
There was a problem hiding this comment.
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.
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.
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.
Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
|
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.
Pendingsection inCHANGELOG.mdFiles changedin the Github PR explorer