Macro elliptic_curve::impl_field_element
source · macro_rules! impl_field_element { ( $fe:tt, $bytes:ty, $uint:ty, $modulus:expr, $arr:ty, $from_mont:ident, $to_mont:ident, $add:ident, $sub:ident, $mul:ident, $neg:ident, $square:ident ) => { ... }; }
Expand description
Provides both inherent and trait impls for a field element type which are backed by a core set of arithmetic functions specified as macro arguments.
Inherent impls
const ZERO: Selfconst ONE: Self(multiplicative identity)pub fn from_be_bytespub fn from_be_slicepub fn from_le_bytespub fn from_le_slicepub fn from_uintfn from_uint_uncheckedpub fn to_be_bytespub fn to_le_bytespub fn to_canonicalpub fn is_oddpub fn is_zeropub fn double
NOTE: field implementations must provide their own inherent impls of the following methods in order for the code generated by this macro to compile:
pub fn invertpub fn sqrt
Trait impls
AsRef<$arr>ConditionallySelectableConstantTimeEqConstantTimeGreaterConstantTimeLessDefaultDefaultIsZeroesEqFieldPartialEq
Ops
AddAddAssignSubSubAssignMulMulAssignNeg