Cryptography Reference
In-Depth Information
CLINT a_l, a2_l;
clint e_l[CLINTMAXSHORT + 1];
CLINTD acc_l;
clint **aptr_l, *ptr_l;
int noofdigits, s, t, i;
ULONG k;
unsigned int lge, bit, digit, fk, word, pow2k, k_mask;
Then comes the usual checking for division by 0 and reduction by 1.
if (EQZ_L (m_l))
{
return E_CLINT_DBZ;
}
if (EQONE_L (m_l))
{
SETZERO_L (p_l);
/* modulus = 1 ==> residue=0*/
return E_CLINT_OK;
}
Base and exponent are copied to the working variables a_l and e_l , and any
leading zeros are purged.
cpy_l (a_l, bas_l);
cpy_l (e_l, exp_l);
Now we process the simple cases a 0 =1 and 0 e =0 ( e> 0 ).
if (EQZ_L (e_l))
{
SETONE_L (p_l);
return E_CLINT_OK;
}
if (EQZ_L (a_l))
{
SETZERO_L (p_l);
return E_CLINT_OK;
}
Search WWH ::




Custom Search