Appendix C. Macros

Error Codes and Status Values

E_CLINT_DBZ

−1

division by zero

E_CLINT_OFL

−2

overflow

E_CLINT_UFL

−3

underflow

E_CLINT_MAL

−4

memory allocation error

E_CLINT_NOR

−5

register not available

E_CLINT_BOR

−6

invalid base in str2clint_l()

E_CLINT_MOD

−7

even modulus in Montgomery reduction

E_CLINT_NPT

−8

null pointer passed as argument

E_VCHECK_OFL

1

vcheck_l() warning: number too long

E_VCHECK_LDZ

2

vcheck_l() warning: leading zeros

E_VCHECK_MEM

−1

vcheck_l() error: null pointer

Additional Constants

BASE

0x10000

base B = 216 of the CLINT number format

BASEMINONE

0xffffU

B − 1

DBASEMINONE

0xffffffffUL

B2 − 1

BASEDIV2

0x8000U

[B/2]

NOOFREGS

16U

standard number of registers in register bank

BITPERDGT

16UL

number of binary digits per CLINT digit

LDBITPERDGT

4U

logarithm of BITPERDGT to base 2

CLINTMAXDIGIT

256U

maximal number of digits to base B of a CLINT object

CLINTMAXSHORT

(CLINTMAXDIGIT + 1)

USHORTs to be allocated for a CLINT object

CLINTMAXBYTE

(CLINTMAXSHORT << 1)

number of allocated bytes for a CLINT object

CLINTMAXBIT

(CLINTMAXDIGIT << 4)

maximal number of binary digits of a CLINT object

r0_l, ... , r15_l

get_reg_l(0), ... , get_reg_l(15)

pointer to CLINT registers 0,..., 15

FLINT_VERMAJ

 

higher version number of the FLINT/C library

FLINT_VERMIN

 

lower version number of the FLINT/C library

FLINT_VERSION

((FLINT_VERMAJ << 8)
+ FLINT_VERMIN)

version number of the FLINT/C library

FLINT_SECURE

0x73, 0

identifier 's' or '' for the FLINT/C security mode

Macros with Parameters

ANDMAX_L (a_l)

SETDIGITS_L((a_l),
(MIN(DIGITS_L(a_l),
(USHORT)CLINTMAXDIGIT));
RMLDZRS_L((a_l))

reduction modulo (Nmax + 1)

ASSIGN_L
     (a_l, b_l)

cpy_l((a_l), (b_l))

assignment a_lb_l

BINSTR_L (n_l)

xclint2str_l((n_l), 2, 0)

conversion of a CLINT object into binary representation

bRandAES_L (S)

((UCHAR)SwitchRandAES_l((S))

generation of a random number of type UCHAR

bRandRMDSHA1_L (S)

((UCHAR)SwitchRandAES_l((S))

generation of a random number of type UCHAR

clint2str_l
     (n_l, base)
CLINT2STR_L
     (n_l, base)

xclint2str_l((n_l),(base),0)

representation of a CLINT object as character string without prefix

DECDIGITS_L (n_l)

(--*(n_l))

reduce number of digits by 1

DECSTR_L (n)

xclint2str_l((n), 10, 0)

conversion of a CLINT object into decimal representation

DIGITS_L (n_l)

(*(n_l))

read number of digits of n_l to base B

DISP_L (S, A)

printf("%s%s
%u bit

",
(S), HEXSTR_L(A), ld_l(A))

standard output of a CLINT object

EQONE_L (a_l)

(equ_l((a_l), one_l) == 1)

comparison a_l == 1

EQZ_L (a_l)

(equ_l((a_l), nul_l) == 1)

comparison a_l == 0

GE_L (a_l, b_l)

(cmp_l((a_l), (b_l)) > −1)

comparison a_lb_l

GT_L (a_l, b_l)

(cmp_l((a_l), (b_l)) == 1)

comparison a_l > b_l

GTZ_L (a_l)

(cmp_l((a_l), nul_l) == 1)

comparison a_l > 0

HEXSTR_L (n_l)

xclint2str_l((n_l), 16, 0)

conversion of a CLINT object into hex representation

INCDIGITS_L (n_l)

(++*(n_l))

increase number of digits by 1

INITRAND64_LT()

seed64_l((unsigned long)
time(NULL)

initialization of random number generator rand64_l() with system clock

INITRANDBBS_LT()

seedBBS_l((unsigned long)
time(NULL))

initialization of the random bit generator randbit_l() by means of system clock

ISEVEN_L (n_l)

(DIGITS_L(n_l) == 0 ||
(DIGITS_L(n_l) > 0 &&
(*(LSDPTR_L(n_l)) & 1U)
== 0))

test whether n_l is odd

ISODD_L (n_l)

(DIGITS_L(n_l) > 0 &&
(*(LSDPTR_L(n_l)) & 1U)
== 1)

test whether n_l is odd

ISPRIME_L (n_l)

prime_l((n_l), 302, 5)

primality test with fixed parameters

LE_L (a_l, b_l)

(cmp_l((a_l), (b_l)) < 1)

comparison a_lb_l

lRandAES_l (S)

(((ULONG)
SwitchRandAES_l((S))
<< 24) | ((ULONG)
SwitchRandAES_l((S))
<< 16)|((ULONG)
SwitchRandAES_l((S))
<< 8) |((ULONG)
SwitchRandAES_l((S)))

generate a random number of type ULONG

lRandRMDSHA1_l (S)

(((ULONG)
SwitchRandRMDSHA1_l((S))
<< 24) | ((ULONG)
SwitchRandRMDSHA1_l((S))
<< 16)|((ULONG)
SwitchRandRMDSHA1_l((S))
<< 8) |((ULONG)
SwitchRandRMDSHA1_l((S)))

generate a random number of type ULONG

LSDPTR_L (n_l)

((n_l) + 1)

pointer to least-significant digit of a CLINT object

LT_L (a_l, b_l)

(cmp_l((a_l), (b_l)) == −1)

comparison a_l < b_l

MAX_L (a_l, b_l)

(GT_L((a_l), (b_l)) ? (a_l) :
(b_l)

maximum of two CLINT values

MEXP_L (a_l, e_l,
      p_l, n_l
mexp5_l((a_l), (e_l),
     (p_l), (n_l))
mexpkm_l((a_l), (e_l),
     (p_l), (n_l))
mexp5m_l((a_l), (e_l),
     (p_l), (n_l))

exponentiation, alternative

MEXP_L (a_l, e_l,
     p_l, n_l)
mexpk_l((a_l), (e_l), (p_l),
(n_l))

exponentiation

MIN_L (a_l, b_l)

(LT_L((a_l), (b_l))
? (a_l) : (b_l))

minimum of two CLINT values

MSDPTR_L (n_l)

((n_l) + DIGITS_L(n_l))

pointer to most-significant digit of a CLINT object

OCTSTR_L (n_l)

xclint2str_l((n_l), 8, 0)

conversion of a CLINT object into octal representation

RMLDZRS_L (n_l)

while((DIGITS_L(n_l) >
0)&& (*MSDPTR_L(n_l) == 0))
{DECDIGITS_L(n_l);}

remove leading zeros from a CLINT object

SET_L(n_l, ul)

ul2clint_l((n_l), (ul))

assignment n_lULONG ul

SETDIGITS_L
     (n_l, l)

(*(n_l) = (USHORT)(l))

set number of digits n_l to l

SETONE_L (n_l)

u2clint_l((n_l), 1U)

set n_l to 1

SETTWO_L (n_l)

u2clint_l((n_l), 2U)

set n_l to 2

SETZERO_L (n_l)

(*(n_l) = 0)

set n_l to 0

sRandAES_l (S)

(((USHORT)
SwitchRandAES_l((S))
<< 8) | (USHORT)
SwitchRandAES_l((S)))

generate a random number of type USHORT

sRandRMDSHA1_l (S)

(((USHORT)
sRandRMDSHA1_l((S))
<< 8) | (USHORT)
sRandRMDSHA1_l((S)))

generate a random number of type USHORT

SWAP (a, b)

((a)^=(b),(b)^=(a),(a)^=(b))

exchange

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)))

exchange two CLINT values

ZEROCLINT_L (n_l)

memset((A), 0, sizeof(A))

delete a CLINT variable by overwriting

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.227.4