Skip to main content

monty_field_element

Macro monty_field_element 

Source
macro_rules! monty_field_element {
    (
        name: $fe:tt,
        params: $params:ty,
        uint: $uint:path,
        doc: $doc:expr
    ) => { ... };
}
Expand description

Implements a field element type whose internal representation is in Montgomery form, providing a combination of trait impls and inherent impls which are const fn where possible.

Accepts a set of const fn arithmetic operation functions as arguments.

§Inherent impls

  • const ZERO: Self
  • const ONE: Self (multiplicative identity)
  • pub fn from_bytes
  • pub fn from_slice
  • pub fn from_uint
  • fn from_uint_unchecked
  • pub fn to_bytes
  • pub fn to_canonical
  • pub fn is_odd
  • pub fn is_zero
  • pub fn double

§Trait impls

  • ConditionallySelectable
  • ConstantTimeEq
  • ConstantTimeGreater
  • ConstantTimeLess
  • CtEq
  • CtSelect
  • Default
  • DefaultIsZeroes
  • Eq
  • Field
  • PartialEq
  • Retrieve

§Ops

  • Add
  • AddAssign
  • Sub
  • SubAssign
  • Mul
  • MulAssign
  • Neg
  • Invert