Cryptography Reference
In-Depth Information
Since we have no need of a sign for natural numbers, we now have all
the required elements for the representation of such numbers. We define the
corresponding data type by
typedef unsigned short clint;
typedef clint CLINT[CLINTMAXDIGIT + 1];
In accordance with this, a large number will be declared by
CLINT n_l;
The declaration of function parameters of type
CLINT
can follow from the
instruction
CLINT n_l
in the function header.
2
The definition of a pointer
myptr_l
to a
CLINT
object occurs via
CLINTPTR myptr_l
or
clint *myptr_l
.
FLINT/C functions can, depending on the setting of the constant
CLINTMAXDIGIT
in
flint.h
, process numbers up to 4096 bits in length, which
corresponds to 1233 decimal digits or 256 digits to the base
2
16
. By changing
CLINTMAXDIGIT
the maximal length can be adjusted as required. The definitions of
other constants depend on this parameter; for example, the number of
USHORT
sin
a
CLINT
object is specified by
#define CLINTMAXSHORT CLINTMAXDIGIT + 1
and the maximal number of processable binary digits is defined by
#define CLINTMAXBIT CLINTMAXDIGIT << 4
Since the constants
CLINTMAXDIGIT
and
CLINTMAXBIT
are used frequently, yet
are rather unwieldy from a typographical point of view, we shall denote these
constants by abbreviations
MAX
B
and
MAX
2
(with the exception of program
code, where the constants will appear in their normal form).
With this definition it follows that
CLINT
objects can assume whole-number
values in the interval
0
,B
MAX
B
1
, respectively
0
,
2
MAX
2
1
. We denote
−
−
the value
B
MAX
B
−
1=2
MAX
2
−
1
, the largest natural number that can be
represented by a
CLINT
object, by
N
max
.
2
In this regard compare Chapters 4 and 9 of the extremely readable topic [Lind], where there
is an extensive explanation of when vectors and pointers in C are equivalent, and above all,
when this is not the case and what types of errors can arise from a misunderstanding of these
issues.