Cryptography Reference
In-Depth Information
if (d > 0)
{
bn_1 += *(msdptrb_l - 1) >> sbitsminusd;
if (DIGITS_L (b_l) > 2)
{
bn_2 = (USHORT)(*(msdptrb_l - 1) << d) + (*(msdptrb_l - 2) >> sbitsminusd);
}
else
{
bn_2 = (USHORT)(*(msdptrb_l - 1) << d);
}
}
else
{
bn_2 = (USHORT)(*(msdptrb_l - 1));
}
Now the pointers
msdptrr_l
and
lsdptrr_l
are set to the most-significant, respec-
tively least-significant, digit of
(
a
m
+
n
a
m
+
n
−
1
...a
m
+1
)
B
in the
CLINT
vector
r_l
, which will represent the remainder of the division. At the digit
a
m
+
n
the
variable
r_l
is initialized to
0
. The pointer
qptr_l
is set to the highest quotient
digit.
msdptrb_l = MSDPTR_L (b_l);
msdptrr_l = MSDPTR_L (r_l) + 1;
lsdptrr_l = MSDPTR_L (r_l) - DIGITS_L (b_l) + 1;
*msdptrr_l = 0;
qptr_l = quot_l + DIGITS_L (r_l) - DIGITS_L (b_l) + 1;
We now enter the main loop. The pointer
lsdptrr_l
runs over the digits
a
m
,a
m
−
2
,...,a
0
of the dividend in
r_l
, and the (implicit) index
i
over the values
i
=
m
+
n,...,n
.
while (lsdptrr_l >= LSDPTR_L (r_l))
{