Cryptography Reference
In-Depth Information
if (a_l[shorts + 1] & m)
{
res=1;
}
a_l[shorts + 1] |= m;
return res;
}
Function:
test a binary digit of a CLINT object
Syntax:
int testbit_l (CLINT a_l, unsigned int pos);
a_l
(
CLINT
argument)
pos
(bit position counted from
0
)
Input:
1
if bit at position
pos
is set
0
otherwise
Return:
int
testbit_l (CLINT a_l, unsigned int pos)
{
int res = 0;
USHORT shorts = (USHORT)(pos >> LDBITPERDGT);
USHORT bitpos = (USHORT)(pos & (BITPERDGT - 1));
if (shorts < DIGITS_L (a_l))
{
if (a_l[shorts + 1] & (USHORT)(1U << bitpos))
res=1;
}
return res;
}
test and delete a bit in a
CLINT
object
Function:
int clearbit_l (CLINT a_l, unsigned int pos);
Syntax:
a_l
(
CLINT
argument)
pos
(bit position counted from
0
)
Input:
a_l
(result)
Output:
1
if bit at position
pos
was set before deletion
0
otherwise
Return: