Expand description
Implements Residues, supporting modular arithmetic with a constant modulus.
Re-exportsยง
pub use macros::*;
Modulesยง
- const_
add ๐ - Additions between residues with a constant modulus
- const_
inv ๐ - Multiplicative inverses of residues with a constant modulus
- const_
mul ๐ - Multiplications between residues with a constant modulus
- const_
neg ๐ - Negations of residues with a constant modulus
- const_
pow ๐ - Exponentiation of residues with a constant modulus
- const_
sub ๐ - Subtractions between residues with a constant modulus
- macros ๐
- Macros to remove the boilerplate code when dealing with constant moduli.
Structsยง
- Residue
- A residue mod
MOD, represented usingLIMBSlimbs. The modulus of this residue is constant, so it cannot be set at runtime. Internally, the value is stored in Montgomery form (multiplied by MOD::R) until it is retrieved.
Traitsยง
- Residue
Params - The parameters to efficiently go to and from the Montgomery form for a given odd modulus. An easy way to generate these parameters is using the
impl_modulus!macro. These parameters are constant, so they cannot be set at runtime.