Cryptography Reference
In-Depth Information
mixed addition of a
CLINT
type and a
USHORT
type
Function:
int uadd_l (CLINT a_l, USHORT b, CLINT s_l);
Syntax:
a_l, b
(summands)
Input:
s_l
(sum)
Output:
E_CLINT_OK
if all is ok
E_CLINT_OFL
if overflow
Return:
int
uadd_l (CLINT a_l, USHORT b, CLINT s_l)
{
int err;
CLINT tmp_l;
u2clint_l (tmp_l, b);
err = add_l (a_l, tmp_l, s_l);
return err;
}
subtraction of a
USHORT
type from a
CLINT
type
Function:
int usub_l (CLINT a_l, USHORT b, CLINT d_l);
Syntax:
a_l
(minuend),
b
(subtrahend)
Input:
d_l
(difference)
Output:
E_CLINT_OK
if all is ok
E_CLINT_UFL
if underflow
Return:
int
usub_l (CLINT a_l, USHORT b, CLINT d_l)
{
int err;
CLINT tmp_l; u2clint_l (tmp_l, b);
err = sub_l (a_l, tmp_l, d_l);
return err;
}