Expand description
Traits for arithmetic operations on elliptic curve field elements.
Traits§
- Add
- The addition operator
+. - AddAssign
- The addition assignment operator
+=. - Batch
Invert - 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 utilizingscratchas temporary storage. - Double
- Perform a doubling (i.e.
self + self). - Invert
- Constant-time inversion.
- Linear
Combination - Linear combination.
- Mul
- The multiplication operator
*. - MulAssign
- The multiplication assignment operator
*=. - MulBy
Generator Vartime - Variable-time multiplication by the generator of the curve group.
- MulVartime
- Variable-time equivalent of the
Multrait. - Neg
- The unary negation operator
-. - Reduce
- Modular reduction from a larger value
T. - Reduce
NonZero - 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 thougha >> banda.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
-=.