Cryptography Reference
In-Depth Information
B.6 Modular Arithmetic: Friend Functions
LINT
madd (const LINT& a,
const LINT& b,
const LINT& m);
modular addition,
c = madd (a,
b, m);
int
mequ (const LINT& a,
const LINT& b,
const LINT& m);
comparison of
a
and
b
modulo
m
if
(mequ (a, b, m))
...
LINT
mexp (const LINT& a,
const LINT& e,
const LINT& m);
modular exponentiation with
Montgomery reduction for odd
modulus
m
,
c = mexp (a, e, m);
LINT
mexp (const LINT& a,
USHORT u,
const LINT& m);
modular exponentiation with
USHORT
exponent, Montgomery
reduction for odd modulus
m
,
c=
mexp (a, u, m);
LINT
mexp (USHORT u,
const LINT& e,
const LINT& m);
modular exponentiation with
USHORT
base, Montgomery reduc-
tion for odd modulus
m
,
c = mexp
(u, e, m);
LINT
mexp2 (const LINT& a,
USHORT u,
const LINT& m);
modular exponentiation with
power of two exponent
2
u
,
c=
mexp2 (a, u, m);
LINT
mexp5m (const LINT& a,
const LINT& e,
const LINT& m);
modular exponentiation with
Montgomery reduction, only for
odd modulus
m
,
c = mexp5m (a,
e, m);
LINT
mexpkm (const LINT& a,
const LINT& b,
const LINT& m);
modular exponentiation with
Montgomery reduction, only for
odd modulus
m
,
c = mexpkm (a,
e, m);
LINT
mmul (const LINT& a,
const LINT& b,
const LINT& m);
modular multiplication,
c = mmul
(a, b, m);