Cryptography Reference
In-Depth Information
void
cpy_l (CLINT dest_l, CLINT src_l)
{
clint *lastsrc_l = MSDPTR_L (src_l);
*dest_l = *src_l;
In the next step leading zeros are found and then ignored. At the same time, the
number of digits of the target object is adjusted.
while ((*lastsrc_l == 0) && (*dest_l > 0))
{
--lastsrc_l;
--*dest_l;
}
Now the relevant digits of the source object are copied into the goal object. Then
the function is terminated.
while (src_l < lastsrc_l)
{
*++dest_l = *++src_l;
}
}
The exchange of the values of two CLINT objects can be accomplished with
the help of the macro SWAP_L , the FLINT/C variant of the macro SWAP , which
manages in an interesting way to accomplish the exchange of two variables using
XOR operations without the requirement of intermediate storage in a temporary
variable:
#define SWAP(a, b) ((a) ˆ =(b), (b) ˆ =(a), (a) ˆ =(b))
#define SWAP_L(a_l, b_l)
\
(xor_l((a_l), (b_l), (a_l)),
\
\
xor_l((b_l), (a_l), (b_l)),
xor_l((a_l), (b_l), (a_l)))
Search WWH ::




Custom Search