Botan

Modular Reducer

License
Botan is released under the Simplified BSD License (see LICENSE.md)

struct  ModularReducer;

Modular Reducer (using Barrett's technique)


const BigInt  multiply()(auto ref const BigInt x, auto ref const BigInt y);

Multiply mod p

Parameters
BigInt x integer
BigInt y integer
Returns
(x * y) % p

const BigInt  square()(auto ref const BigInt x);

Square mod p

Parameters
BigInt x integer
Returns
(x * x) % p

const BigInt  cube()(auto ref const BigInt x);

Cube mod p

Parameters
BigInt x integer
Returns
(x * x * x) % p