pub struct ExtElem(/* private fields */);Expand description
Instances of ExtElem are elements of a finite field F_p^4. They are
represented as elements of F_p[X] / (X^4 + 11). This large
finite field (about 2^128 elements) is used when the security of
operations depends on the size of the field. The field extension ExtElem
has Elem as a subfield, so operations on elements of each are compatible.
The irreducible polynomial x^4 + 11 was chosen because 11 is
the simplest choice of BETA for x^4 + BETA that makes this polynomial
irreducible.
Implementations§
Trait Implementations§
Source§impl AddAssign<Elem> for ExtElem
impl AddAssign<Elem> for ExtElem
Source§fn add_assign(&mut self, rhs: Elem)
fn add_assign(&mut self, rhs: Elem)
Promoting addition case for BabyBear Elem
Source§impl AddAssign for ExtElem
impl AddAssign for ExtElem
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Simple addition case for Baby Bear ExtElem
Source§impl CheckedBitPattern for ExtElem
impl CheckedBitPattern for ExtElem
Source§impl Elem for ExtElem
impl Elem for ExtElem
Source§fn from_u64(val: u64) -> Self
fn from_u64(val: u64) -> Self
Convert from a u64 to a base field elem, then cast to the extension field.
Source§const INVALID: Self
const INVALID: Self
Source§fn to_u32_words(&self) -> Vec<u32>
fn to_u32_words(&self) -> Vec<u32>
Source§fn from_u32_words(val: &[u32]) -> Self
fn from_u32_words(val: &[u32]) -> Self
Source§fn is_valid(&self) -> bool
fn is_valid(&self) -> bool
Source§fn is_reduced(&self) -> bool
fn is_reduced(&self) -> bool
Source§fn valid_or_zero(&self) -> Self
fn valid_or_zero(&self) -> Self
Source§fn ensure_valid(&self) -> &Self
fn ensure_valid(&self) -> &Self
Source§fn ensure_reduced(&self) -> &Self
fn ensure_reduced(&self) -> &Self
Source§fn as_u32_slice(elems: &[Self]) -> &[u32]
fn as_u32_slice(elems: &[Self]) -> &[u32]
Source§fn as_u32_slice_unchecked(elems: &[Self]) -> &[u32]
fn as_u32_slice_unchecked(elems: &[Self]) -> &[u32]
Source§fn from_u32_slice(u32s: &[u32]) -> &[Self]
fn from_u32_slice(u32s: &[u32]) -> &[Self]
Source§impl ExtElem for ExtElem
impl ExtElem for ExtElem
Source§fn from_subfield(elem: &Elem) -> Self
fn from_subfield(elem: &Elem) -> Self
Source§fn from_subelems(elems: impl IntoIterator<Item = Self::SubElem>) -> Self
fn from_subelems(elems: impl IntoIterator<Item = Self::SubElem>) -> Self
Source§impl MulAssign<Elem> for ExtElem
impl MulAssign<Elem> for ExtElem
Source§fn mul_assign(&mut self, rhs: Elem)
fn mul_assign(&mut self, rhs: Elem)
Simple multiplication case by a Baby Bear Elem
Source§impl MulAssign for ExtElem
impl MulAssign for ExtElem
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
*= operation. Read moreSource§impl SubAssign<Elem> for ExtElem
impl SubAssign<Elem> for ExtElem
Source§fn sub_assign(&mut self, rhs: Elem)
fn sub_assign(&mut self, rhs: Elem)
Promoting subtraction case for BabyBear Elem
Source§impl SubAssign for ExtElem
impl SubAssign for ExtElem
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Simple subtraction case for Baby Bear ExtElem