Crate modutil

Source
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 x that satisfies ax = 1 (mod m).
If not found, return None.
pow_mod
Calculate a^exp (mod m).