Cryptography Reference
In-Depth Information
if (la < lb)
{
return -1;
}
If the operands have the same number of digits, then the actual values must be
compared. For this we begin with a comparison of the most-significant digits and
proceed digit by digit until two digits are found that are unequal or until the least-
significant digits are reached.
msdptra_l = a_l + la;
msdptrb_l = b_l + lb;
while ((*msdptra_l == *msdptrb_l) && (msdptra_l > a_l))
{
msdptra_l--;
msdptrb_l--;
}
Now
we
compare
the
two
digits
and
make
our
determination,
and
the
corresponding function value is returned.
if (msdptra_l == a_l)
{
return 0;
}
if (*msdptra_l > *msdptrb_l)
{
return 1;
}
else
{
return -1;
}
}
If we are interested in the equality of two CLINT values, then the application of
the function cmp_l() is a bit more than is necessary. In this case there is a simpler
variant, which avoids the size comparison.
Search WWH ::




Custom Search