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

Get Cryptography in C and C++, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.