pub struct FieldElement2625x4(pub(crate) [u32x8; 5]);Expand description
A vector of four field elements.
Each operation on a FieldElement2625x4 has documented effects on
the bounds of the coefficients. This API is designed for speed
and not safety; it is the caller’s responsibility to ensure that
the post-conditions of one operation are compatible with the
pre-conditions of the next.
Tuple Fields§
§0: [u32x8; 5]Implementations§
Source§impl FieldElement2625x4
impl FieldElement2625x4
pub const ZERO: FieldElement2625x4
Sourcepub fn split(&self) -> [FieldElement51; 4]
pub fn split(&self) -> [FieldElement51; 4]
Split this vector into an array of four (serial) field elements.
Sourcepub fn shuffle(&self, control: Shuffle) -> FieldElement2625x4
pub fn shuffle(&self, control: Shuffle) -> FieldElement2625x4
Rearrange the elements of this vector according to control.
The control parameter should be a compile-time constant, so
that when this function is inlined, LLVM is able to lower the
shuffle using an immediate.
Sourcepub fn blend(
&self,
other: FieldElement2625x4,
control: Lanes,
) -> FieldElement2625x4
pub fn blend( &self, other: FieldElement2625x4, control: Lanes, ) -> FieldElement2625x4
Blend self with other, taking lanes specified in control from other.
The control parameter should be a compile-time constant, so
that this function can be inlined and LLVM can lower it to a
blend instruction using an immediate.
Sourcepub fn splat(x: &FieldElement51) -> FieldElement2625x4
pub fn splat(x: &FieldElement51) -> FieldElement2625x4
Convenience wrapper around new(x,x,x,x).
Sourcepub fn new(
x0: &FieldElement51,
x1: &FieldElement51,
x2: &FieldElement51,
x3: &FieldElement51,
) -> FieldElement2625x4
pub fn new( x0: &FieldElement51, x1: &FieldElement51, x2: &FieldElement51, x3: &FieldElement51, ) -> FieldElement2625x4
Create a FieldElement2625x4 from four FieldElement51s.
§Postconditions
The resulting FieldElement2625x4 is bounded with \( b < 0.0002 \).
Sourcepub fn negate_lazy(&self) -> FieldElement2625x4
pub fn negate_lazy(&self) -> FieldElement2625x4
Sourcepub fn diff_sum(&self) -> FieldElement2625x4
pub fn diff_sum(&self) -> FieldElement2625x4
Sourcepub fn reduce(&self) -> FieldElement2625x4
pub fn reduce(&self) -> FieldElement2625x4
Reduce this vector of field elements \(\mathrm{mod} p\).
§Postconditions
The coefficients of the result are bounded with \( b < 0.0002 \).
Sourcefn reduce64(z: [u64x4; 10]) -> FieldElement2625x4
fn reduce64(z: [u64x4; 10]) -> FieldElement2625x4
Given an array of wide coefficients, reduce them to a FieldElement2625x4.
§Postconditions
The coefficients of the result are bounded with \( b < 0.007 \).
Sourcepub fn square_and_negate_D(&self) -> FieldElement2625x4
pub fn square_and_negate_D(&self) -> FieldElement2625x4
Trait Implementations§
Source§impl Add for FieldElement2625x4
impl Add for FieldElement2625x4
Source§fn add(self, rhs: FieldElement2625x4) -> FieldElement2625x4
fn add(self, rhs: FieldElement2625x4) -> FieldElement2625x4
Add two FieldElement2625x4s, without performing a reduction.
Source§type Output = FieldElement2625x4
type Output = FieldElement2625x4
+ operator.Source§impl Clone for FieldElement2625x4
impl Clone for FieldElement2625x4
Source§fn clone(&self) -> FieldElement2625x4
fn clone(&self) -> FieldElement2625x4
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ConditionallySelectable for FieldElement2625x4
impl ConditionallySelectable for FieldElement2625x4
Source§fn conditional_select(
a: &FieldElement2625x4,
b: &FieldElement2625x4,
choice: Choice,
) -> FieldElement2625x4
fn conditional_select( a: &FieldElement2625x4, b: &FieldElement2625x4, choice: Choice, ) -> FieldElement2625x4
Source§fn conditional_assign(&mut self, other: &FieldElement2625x4, choice: Choice)
fn conditional_assign(&mut self, other: &FieldElement2625x4, 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)
self and other if choice == 1; otherwise,
reassign both unto themselves. Read moreSource§impl Debug for FieldElement2625x4
impl Debug for FieldElement2625x4
Source§impl Mul<&FieldElement2625x4> for &FieldElement2625x4
impl Mul<&FieldElement2625x4> for &FieldElement2625x4
Source§fn mul(self, rhs: &FieldElement2625x4) -> FieldElement2625x4
fn mul(self, rhs: &FieldElement2625x4) -> FieldElement2625x4
Source§type Output = FieldElement2625x4
type Output = FieldElement2625x4
* operator.Source§impl Neg for FieldElement2625x4
impl Neg for FieldElement2625x4
Source§fn neg(self) -> FieldElement2625x4
fn neg(self) -> FieldElement2625x4
Negate this field element, performing a reduction.
If the coefficients are known to be small, use negate_lazy
to avoid performing a reduction.
§Preconditions
The coefficients of self must be bounded with \( b < 4.0 \).
§Postconditions
The coefficients of the result are bounded with \( b < 0.0002 \).
Source§type Output = FieldElement2625x4
type Output = FieldElement2625x4
- operator.