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

pub struct FieldElement2625x4(pub(crate) [u32x8; 5]);
This is supported on crate feature 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).

Create a FieldElement2625x4 from four FieldElement51s.

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 FieldElement2625x4s, without performing a reduction.

The resulting type after applying the + operator.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Select a or b according to choice. Read more

Conditionally assign other to self, according to choice. Read more

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

Formats the value using the given formatter. 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 \).

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

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

The resulting type after applying the - operator.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Numeric cast from self to T.

Performs the conversion.

Safe lossless bitwise transmute from T to Self.

Numeric cast from T to Self.

Performs the conversion.

Safe lossless bitwise transmute from self to T.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

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

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.