pub struct F2Element { /* private fields */ }Expand description
Element of the finite field $\mathbb{F}_2$
Implementations§
Trait Implementations§
Source§impl ConditionallySelectable for F2Element
impl ConditionallySelectable for F2Element
Source§fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
Source§fn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
Source§fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
Conditionally swap
self and other if choice == 1; otherwise,
reassign both unto themselves. Read moreSource§impl ConstantTimeEq for F2Element
impl ConstantTimeEq for F2Element
Source§impl FieldFromRepr for F2Element
impl FieldFromRepr for F2Element
Source§impl FieldOps for F2Element
impl FieldOps for F2Element
Source§fn norm(&self) -> Self
fn norm(&self) -> Self
compute the norm of
self down to $\mathbb{F}_p$ (as an
element of type Self)Source§fn trace(&self) -> Self
fn trace(&self) -> Self
compute the trace of
self down to $\mathbb{F}_p$ (as an
element of type Self)Source§fn legendre(&self) -> i8
fn legendre(&self) -> i8
Computes the “Legendre symbol” i.e., if 0,1,-1 depending if
self is 0, a square or a nonsquare.Source§fn characteristic() -> Vec<u64>
fn characteristic() -> Vec<u64>
Returns the characteristic of the field.
Source§fn pow_vartime(&self, exp: &[u64]) -> Self
fn pow_vartime(&self, exp: &[u64]) -> Self
self^exp using square-and multiply (litte-endian bit order) Read moreSource§fn pow(&self, exp: &[u64]) -> Self
fn pow(&self, exp: &[u64]) -> Self
self^pow in constant time using a Montgomery ladder Read moreSource§fn frobenius_pow(&self, k: u32) -> Self
fn frobenius_pow(&self, k: u32) -> Self
Compute
self^{p^k} a power of the frobeniusSource§fn inverse_and_sqrt(&self) -> (CtOption<Self>, CtOption<Self>)
fn inverse_and_sqrt(&self) -> (CtOption<Self>, CtOption<Self>)
Computes the inverse and square root of
self Read moreSource§fn invertme_sqrtother(&self, rhs: &Self) -> (CtOption<Self>, CtOption<Self>)
fn invertme_sqrtother(&self, rhs: &Self) -> (CtOption<Self>, CtOption<Self>)
Source§fn sqrt_ratio(&self, rhs: &Self) -> CtOption<Self>
fn sqrt_ratio(&self, rhs: &Self) -> CtOption<Self>
Computes the squareroot of a ratio
self/rhs Read moreSource§impl FieldRandom for F2Element
impl FieldRandom for F2Element
impl Copy for F2Element
impl Eq for F2Element
impl StructuralPartialEq for F2Element
Auto Trait Implementations§
impl Freeze for F2Element
impl RefUnwindSafe for F2Element
impl Send for F2Element
impl Sync for F2Element
impl Unpin for F2Element
impl UnsafeUnpin for F2Element
impl UnwindSafe for F2Element
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