Module elliptic_curve::ops

source ·
Expand description

Traits for arithmetic operations on elliptic curve field elements.

Traits§

  • The addition operator +.
  • The addition assignment operator +=.
  • 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.
  • Perform an inversion on a field element (i.e. base field element or scalar)
  • Linear combination.
  • Linear combination (extended version).
  • The multiplication operator *.
  • Multiplication by the generator.
  • The unary negation operator -.
  • Modular reduction.
  • Modular reduction to a non-zero output.
  • 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.
  • The right shift assignment operator >>=.
  • The subtraction operator -.
  • The subtraction assignment operator -=.