Skip to main content

Module ops

Module ops 

Source
Expand description

Traits for arithmetic operations on elliptic curve field elements.

Traits§

Add
The addition operator +.
AddAssign
The addition assignment operator +=.
BatchInvert
Perform a batched inversion on a slice of field elements (i.e. base field elements or scalars) at an amortized cost that should be practically as efficient as a single inversion, writing the field element inversions into element, and utilizing scratch as temporary storage.
Double
Perform a doubling (i.e. self + self).
Invert
Constant-time inversion.
LinearCombination
Linear combination.
Mul
The multiplication operator *.
MulAssign
The multiplication assignment operator *=.
MulByGeneratorVartime
Variable-time multiplication by the generator of the curve group.
MulVartime
Variable-time equivalent of the Mul trait.
Neg
The unary negation operator -.
Reduce
Modular reduction from a larger value T.
ReduceNonZero
Modular reduction to a non-zero output.
Retrieve
A generalization for numbers kept in optimized representations (e.g. Montgomery) that can be converted back to the original form.
Shr
The right shift operator >>. Note that because this trait is implemented for all integer types with multiple right-hand-side types, Rust’s type checker has special handling for _ >> _, setting the result type for integer operations to the type of the left-hand-side operand. This means that though a >> b and a.shr(b) are one and the same from an evaluation standpoint, they are different when it comes to type inference.
ShrAssign
The right shift assignment operator >>=.
Sub
The subtraction operator -.
SubAssign
The subtraction assignment operator -=.