Portability | Good |
---|---|
Stability | experimental |
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Safe Haskell | Safe-Inferred |
Documentation
exponantiation_rtl_binary :: Integer -> Integer -> Integer -> IntegerSource
exponantiation_rtl_binary computes modular exponantiation as b^e mod m using the right-to-left binary exponentiation algorithm (HAC 14.79)
exponantiation :: Integer -> Integer -> Integer -> IntegerSource
exponantiation computes modular exponantiation as b^e mod m using repetitive squaring.
inverse :: Integer -> Integer -> Maybe IntegerSource
inverse computes the modular inverse as in g^(-1) mod m
inverseCoprimes :: Integer -> Integer -> IntegerSource
Compute the modular inverse of 2 coprime numbers. This is equivalent to inverse except that the result is known to exists.
if the numbers are not defined as coprime, this function will raise a CoprimesAssertionError.