Available on crate feature
arithmetic
only.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 sequence of field elements (i.e. base field elements or scalars) at an amortized cost that should be practically as efficient as a single inversion.
- Invert
- Perform an inversion on a field element (i.e. base field element or scalar)
- Linear
Combination - Linear combination.
- Linear
Combination Ext - Linear combination (extended version).
- Mul
- The multiplication operator
*
. - MulBy
Generator - Multiplication by the generator.
- Neg
- The unary negation operator
-
. - Reduce
- Modular reduction.
- Reduce
NonZero - Modular reduction to a non-zero output.
- 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 >> b
anda.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
-=
.