Cryptography Reference
In-Depth Information
comparison of two CLINT objects
Function:
int cmp_l (CLINT a_l, CLINT b_l);
Syntax:
a_l , b_l (arguments)
Input:
1 if ( value of a_l ) < ( value of b_l )
0 if ( value of a_l )=( value of b_l )
1 if ( value of a_l ) > ( value of b_l )
Return:
int
cmp_l (CLINT a_l, CLINT b_l)
{
clint *msdptra_l, *msdptrb_l;
int la = DIGITS_L (a_l);
int lb = DIGITS_L (b_l);
The first test checks whether both arguments have length, and hence value, 0 .
Then any leading zeros are eliminated, and a decision is attempted on the basis
of the number of digits.
if(la==0&&lb==0)
{
return 0;
}
while (a_l[la] == 0 && la > 0)
{
--la;
}
while (b_l[lb] == 0 && lb > 0)
{
--lb;
}
if(la==0&&lb==0)
{
return 0;
}
if (la > lb)
{
return 1;
}
 
Search WWH ::




Custom Search