Portability | Good |
---|---|
Stability | experimental |
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Safe Haskell | Safe-Infered |
Crypto.Number.ModArithmetic
Description
Documentation
exponantiation_rtl_binary :: Integer -> Integer -> Integer -> Integer
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 -> Integer
exponantiation computes modular exponantiation as b^e mod m using repetitive squaring.
inverse :: Integer -> Integer -> Maybe Integer
inverse computes the modular inverse as in g^(-1) mod m
inverseCoprimes :: Integer -> Integer -> Integer
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.