Struct curve25519_dalek::backend::vector::avx2::field::FieldElement2625x4 [−][src]
simd_backend
and (target features avx2
or avx512ifma
) and target feature avx2
and non-target feature avx512ifma
only.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
Split this vector into an array of four (serial) field elements.
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.
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.
Construct a vector of zeros.
Convenience wrapper around new(x,x,x,x)
.
pub 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 FieldElement51
s.
Postconditions
The resulting FieldElement2625x4
is bounded with \( b < 0.0002 \).
Given \((A,B,C,D)\), compute \((-A,-B,-C,-D)\), without performing a reduction.
Preconditions
The coefficients of self
must be bounded with \( b < 0.999 \).
Postconditions
The coefficients of the result are bounded with \( b < 1 \).
Given self = (A,B,C,D)
, compute (B - A, B + A, D - C, D + C)
.
Preconditions
The coefficients of self
must be bounded with \( b < 0.01 \).
Postconditions
The coefficients of the result are bounded with \( b < 1.6 \).
Reduce this vector of field elements \(\mathrm{mod} p\).
Postconditions
The coefficients of the result are bounded with \( b < 0.0002 \).
Given an array of wide coefficients, reduce them to a FieldElement2625x4
.
Postconditions
The coefficients of the result are bounded with \( b < 0.007 \).
Square this field element, and negate the result’s \(D\) value.
Preconditions
The coefficients of self
must be bounded with \( b < 1.5 \).
Postconditions
The coefficients of the result are bounded with \( b < 0.007 \).
Trait Implementations
Add two FieldElement2625x4
s, without performing a reduction.
type Output = FieldElement2625x4
type Output = FieldElement2625x4
The resulting type after applying the +
operator.
fn conditional_select(
a: &FieldElement2625x4,
b: &FieldElement2625x4,
choice: Choice
) -> FieldElement2625x4
fn conditional_select(
a: &FieldElement2625x4,
b: &FieldElement2625x4,
choice: Choice
) -> FieldElement2625x4
Select a
or b
according to choice
. Read more
Conditionally assign other
to self
, according to choice
. Read more
Multiply self
by rhs
.
Preconditions
The coefficients of self
must be bounded with \( b < 2.5 \).
The coefficients of rhs
must be bounded with \( b < 1.75 \).
Postconditions
The coefficients of the result are bounded with \( b < 0.007 \).
type Output = FieldElement2625x4
type Output = FieldElement2625x4
The resulting type after applying the *
operator.
Perform a multiplication by a vector of small constants.
Postconditions
The coefficients of the result are bounded with \( b < 0.007 \).
type Output = FieldElement2625x4
type Output = FieldElement2625x4
The resulting type after applying the *
operator.
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 \).
type Output = FieldElement2625x4
type Output = FieldElement2625x4
The resulting type after applying the -
operator.
Auto Trait Implementations
impl RefUnwindSafe for FieldElement2625x4
impl Send for FieldElement2625x4
impl Sync for FieldElement2625x4
impl Unpin for FieldElement2625x4
impl UnwindSafe for FieldElement2625x4
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn cast(self) -> U
pub fn cast(self) -> U
Numeric cast from self
to T
.
pub fn from_bits(t: T) -> T
pub fn from_bits(t: T) -> T
Safe lossless bitwise transmute from T
to Self
.
pub fn from_cast(t: T) -> T
pub fn from_cast(t: T) -> T
Numeric cast from T
to Self
.
pub fn into_bits(self) -> U
pub fn into_bits(self) -> U
Safe lossless bitwise transmute from self
to T
.