Cryptography Reference
In-Depth Information
int
proot_l (CLINT a_l, CLINT p_l, CLINT x_l)
{
CLINT b_l, q_l, t_l, y_l, z_l;
int r, m;
if (EQZ_L (p_l) || ISEVEN_L (p_l))
{
return -1;
}
If a_l == 0 , the result is 0 .
if (EQZ_L (a_l))
{
SETZERO_L (x_l);
return 0;
}
Step 1: Find a quadratic nonresidue.
cpy_l (q_l, p_l);
dec_l (q_l);
r = twofact_l (q_l, q_l);
cpy_l (z_l, two_l);
while (jacobi_l (z_l, p_l) == 1)
{
inc_l (z_l);
}
mexp_l (z_l, q_l, z_l, p_l);
Step 2: Initialization of the recursion.
cpy_l (y_l, z_l);
dec_l (q_l);
shr_l (q_l);
mexp_l (a_l, q_l, x_l, p_l);
msqr_l (x_l, b_l, p_l);
mmul_l (b_l, a_l, b_l, p_l);
mmul_l (x_l, a_l, x_l, p_l);
Search WWH ::




Custom Search