Cryptography Reference
In-Depth Information
for (i = 1; i < noofeq; i++)
{
ai_l = *(coeff_l++);
mi_l = *(coeff_l++);
xgcd_l (m_l, mi_l, g_l, u_l, &sign_u, v_l, &sign_v);
if (!EQONE_L (g_l))
{
return 2;
}
In the following an overflow error is recorded. At the end of the function the status
is indicated in the return of the error code stored in
error
.
err = mul_l (u_l, m_l, u_l);
if (E_CLINT_OK == error)
{
error = err;
}
err = mul_l (u_l, ai_l, u_l);
if (E_CLINT_OK == error)
{
error = err;
}
err = mul_l (v_l, mi_l, v_l);
if (E_CLINT_OK == error)
{
error = err;
}
err = mul_l (v_l, x_l, v_l);
if (E_CLINT_OK == error)
{
error = err;
}
The auxiliary functions
sadd()
and
smod()
take care of the signs
sign_u
and
sign_v
(respectively
sign_x
) of the variables
u_l
and
v_l
(respectively 4).