Function ADS::mulMod

Function Documentation

constexpr U64 ADS::mulMod(U64 a, U64 b, U64 m)

a b mod m, exact for any a, b and m: by the product of 64 bits for m <= 2^32, by mulMod61() for m = 2^61 - 1, by the product of 128 bits or else by doubling and adding

Pre:

m >= 1

Post:

the result is below m