[][src]Struct curve25519_dalek::backend::vector::avx2::field::FieldElement2625x4

pub struct FieldElement2625x4(pub(crate) [u32x8; 5]);
This is supported on feature="simd_backend" and (target feature avx2 or target feature avx512ifma) and target feature avx2 and non-target feature avx512ifma only.

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.

Methods

impl FieldElement2625x4[src]

pub fn split(&self) -> [FieldElement51; 4][src]

This is supported on feature="simd_backend" and (target feature avx2 or target feature avx512ifma) and target feature avx2 and non-target feature avx512ifma only.

Split this vector into an array of four (serial) field elements.

pub fn shuffle(&self, control: Shuffle) -> FieldElement2625x4[src]

This is supported on feature="simd_backend" and (target feature avx2 or target feature avx512ifma) and target feature avx2 and non-target feature avx512ifma only.

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.

pub fn blend(
    &self,
    other: FieldElement2625x4,
    control: Lanes
) -> FieldElement2625x4
[src]

This is supported on feature="simd_backend" and (target feature avx2 or target feature avx512ifma) and target feature avx2 and non-target feature avx512ifma only.

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.

pub fn zero() -> FieldElement2625x4[src]

This is supported on feature="simd_backend" and (target feature avx2 or target feature avx512ifma) and target feature avx2 and non-target feature avx512ifma only.

Construct a vector of zeros.

pub fn splat(x: &FieldElement51) -> FieldElement2625x4[src]

This is supported on feature="simd_backend" and (target feature avx2 or target feature avx512ifma) and target feature avx2 and non-target feature avx512ifma only.

Convenience wrapper around new(x,x,x,x).

pub fn new(
    x0: &FieldElement51,
    x1: &FieldElement51,
    x2: &FieldElement51,
    x3: &FieldElement51
) -> FieldElement2625x4
[src]

This is supported on feature="simd_backend" and (target feature avx2 or target feature avx512ifma) and target feature avx2 and non-target feature avx512ifma only.

Create a FieldElement2625x4 from four FieldElement51s.

Postconditions

The resulting FieldElement2625x4 is bounded with \( b < 0.0002 \).

pub fn negate_lazy(&self) -> FieldElement2625x4[src]

This is supported on feature="simd_backend" and (target feature avx2 or target feature avx512ifma) and target feature avx2 and non-target feature avx512ifma only.

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 \).

pub fn diff_sum(&self) -> FieldElement2625x4[src]

This is supported on feature="simd_backend" and (target feature avx2 or target feature avx512ifma) and target feature avx2 and non-target feature avx512ifma only.

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 \).

pub fn reduce(&self) -> FieldElement2625x4[src]

This is supported on feature="simd_backend" and (target feature avx2 or target feature avx512ifma) and target feature avx2 and non-target feature avx512ifma only.

Reduce this vector of field elements \(\mathrm{mod} p\).

Postconditions

The coefficients of the result are bounded with \( b < 0.0002 \).

fn reduce64(z: [u64x4; 10]) -> FieldElement2625x4[src]

This is supported on feature="simd_backend" and (target feature avx2 or target feature avx512ifma) and target feature avx2 and non-target feature avx512ifma only.

Given an array of wide coefficients, reduce them to a FieldElement2625x4.

Postconditions

The coefficients of the result are bounded with \( b < 0.007 \).

pub fn square_and_negate_D(&self) -> FieldElement2625x4[src]

This is supported on feature="simd_backend" and (target feature avx2 or target feature avx512ifma) and target feature avx2 and non-target feature avx512ifma only.

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

impl Clone for FieldElement2625x4[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for FieldElement2625x4[src]

impl Copy for FieldElement2625x4[src]

impl Add<FieldElement2625x4> for FieldElement2625x4[src]

type Output = FieldElement2625x4

The resulting type after applying the + operator.

fn add(self, rhs: FieldElement2625x4) -> FieldElement2625x4[src]

Add two FieldElement2625x4s, without performing a reduction.

impl Mul<(u32, u32, u32, u32)> for FieldElement2625x4[src]

type Output = FieldElement2625x4

The resulting type after applying the * operator.

fn mul(self, scalars: (u32, u32, u32, u32)) -> FieldElement2625x4[src]

Perform a multiplication by a vector of small constants.

Postconditions

The coefficients of the result are bounded with \( b < 0.007 \).

impl<'a, 'b> Mul<&'b FieldElement2625x4> for &'a FieldElement2625x4[src]

type Output = FieldElement2625x4

The resulting type after applying the * operator.

fn mul(self, rhs: &'b FieldElement2625x4) -> FieldElement2625x4[src]

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 \).

impl Neg for FieldElement2625x4[src]

type Output = FieldElement2625x4

The resulting type after applying the - operator.

fn neg(self) -> FieldElement2625x4[src]

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 \).

impl ConditionallySelectable for FieldElement2625x4[src]

fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)[src]

Conditionally swap self and other if choice == 1; otherwise, reassign both unto themselves. Read more

Auto Trait Implementations

impl Send for FieldElement2625x4

impl Sync for FieldElement2625x4

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> FromCast for T

impl<T, U> Cast for T where
    U: FromCast<T>, 

impl<T, U> IntoBits for T where
    U: FromBits<T>, 

impl<T> FromBits for T

impl<T> Same for T

type Output = T

Should always be Self