pub struct Fe(pub [u64; 5]);Expand description
A field element modulo 2^255 - 19.
Tuple Fields§
§0: [u64; 5]Implementations§
Source§impl Fe
impl Fe
Sourcepub fn sub(&self, other: &Fe) -> Fe
pub fn sub(&self, other: &Fe) -> Fe
Field subtraction, via self + 2p - other so limbs stay non-negative.
Sourcepub fn invert(&self) -> Fe
pub fn invert(&self) -> Fe
Multiplicative inverse, self^(p-2), with inverse(0) == 0.
Uses the standard addition chain: 254 squarings and 11 multiplications.
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Fe
pub fn from_bytes(bytes: &[u8; 32]) -> Fe
Decode 32 little-endian bytes, ignoring the top bit as RFC 7748 requires.
Sourcepub fn cmov(a: &mut Fe, b: &Fe, choice: Choice)
pub fn cmov(a: &mut Fe, b: &Fe, choice: Choice)
Constant-time conditional move: a = b when choice is true.
Sourcepub fn is_negative(&self) -> Choice
pub fn is_negative(&self) -> Choice
The least significant bit of the canonical encoding — the “sign” used by Edwards point compression.
Trait Implementations§
impl Copy for Fe
impl Eq for Fe
impl StructuralPartialEq for Fe
Auto Trait Implementations§
impl Freeze for Fe
impl RefUnwindSafe for Fe
impl Send for Fe
impl Sync for Fe
impl Unpin for Fe
impl UnsafeUnpin for Fe
impl UnwindSafe for Fe
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more