Expand description
Provide methods to support modular arithmetic.
Implemented features is still few and the API is subject to significant change.
Structs§
- Barrett
- Provide a method to perform Barrett Reduction.
- Montgomery
- Provides a method to perform Montgomery Reduction.
Functions§
- crt
- If x satisfies x = p (mod m) and x = q (mod n) is found, return Some(x).
Otherwise, return None. - inverse_
mod - Find
xthat satisfiesax = 1 (mod m).
If not found, returnNone. - pow_mod
- Calculate
a^exp (mod m).