Skip to main content

Module const_monty_form

Module const_monty_form 

Source
Expand description

Implements ConstMontyForms, supporting modular arithmetic with a constant modulus.

Modulesยง

add ๐Ÿ”’
Additions between integers in Montgomery form with a constant modulus.
ct ๐Ÿ”’
Constant-time support: impls of Ct* traits and constant-time const fn operations.
invert ๐Ÿ”’
Multiplicative inverses of integers in Montgomery form with a constant modulus.
lincomb ๐Ÿ”’
Linear combinations of integers n Montgomery form with a constant modulus.
macros ๐Ÿ”’
Macros to remove the boilerplate code when dealing with constant moduli. ConstMontyForm/ConstMontyParams support macros.
mod_symbol ๐Ÿ”’
Modular symbol calculation for integers in Montgomery form with a constant modulus.
mul ๐Ÿ”’
Multiplications between integers in Montgomery form with a constant modulus.
neg ๐Ÿ”’
Negations of integers in Montgomery form with a constant modulus.
pow ๐Ÿ”’
Exponentiation of integers in Montgomery form with a constant modulus.
reduce ๐Ÿ”’
sqrt ๐Ÿ”’
sub ๐Ÿ”’
Subtractions between integers in Montgomery form with a constant modulus.

Structsยง

ConstMontyForm
An integer in Montgomery form modulo MOD, represented using LIMBS limbs. The modulus is constant, so it cannot be set at runtime.

Traitsยง

ConstMontyParams
Trait representing a modulus and its associated constants for converting in and out of Montgomery form.
ConstPrimeMontyParams
Trait representing a prime modulus and its associated constants for converting in and out of Montgomery form.