-
Notifications
You must be signed in to change notification settings - Fork 2
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
patch 3.2.0 #4
base: v3.2.0
Are you sure you want to change the base?
patch 3.2.0 #4
Conversation
src/backend/serial/u64/field.rs
Outdated
pub(crate) const fn from_limbs(limbs: [u64; 5]) -> FieldElement51 { | ||
FieldElement51(limbs) | ||
} | ||
/// The scalar \\( 0 \\). | ||
pub const ZERO: FieldElement51 = FieldElement51::from_limbs([0, 0, 0, 0, 0]); | ||
/// The scalar \\( 1 \\). | ||
pub const ONE: FieldElement51 = FieldElement51::from_limbs([1, 0, 0, 0, 0]); | ||
/// The scalar \\( -1 \\). | ||
pub const MINUS_ONE: FieldElement51 = FieldElement51::from_limbs([ | ||
2251799813685228, | ||
2251799813685247, | ||
2251799813685247, | ||
2251799813685247, | ||
2251799813685247, | ||
]); |
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.
Where did this come from?
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.
It's from patch 4.1.3. We mostly just need ONE for the patch so I can delete ZERO and MINUS_ONE
/// Get the bits of the scalar, in little-endian order | ||
pub(crate) fn bits_le(&self) -> impl DoubleEndedIterator<Item = bool> + '_ { | ||
(0..256).map(move |i| { | ||
// As i runs from 0..256, the bottom 3 bits index the bit, while the upper bits index | ||
// the byte. Since self.bytes is little-endian at the byte level, this iterator is | ||
// little-endian on the bit level | ||
((self.bytes[i >> 3] >> (i & 7)) & 1u8) == 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.
Where did this come from?
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.
need it for let a_bits = a.bits_le().collect::<Vec>(); in vartime_double_base.rs (from 4.1.3 patch)
No description provided.