Cryptography Reference
In-Depth Information
format) and COFF (common object file format), respectively, as well as in the
form of a LINUX archive, and are used instead of the corresponding C functions
when in translating C programs the macro FLINT_ASM is defined and the assembler
object modules from the libraries, respectively archives, are linked.
A typical compiler call, here for the GNU compiler gcc , looks something like
the following (with the paths to the source directories suppressed):
gcc -O2 -o rsademo rsademo.cpp rsakey.cpp flintpp.cpp
randompp.cpp flint.c aes.c ripemd.c sha256.c entropy.c
random.c -lstdc++
The C++ header files following the ANSI standard are used when in
compilation the macro FLINTPP_ANSI is defined; otherwise, the traditional header
files xxxxx.h are used.
Depending on the computer platform, there may be deviations with regard
to the compiler switches; but to achieve maximum performance the options for
speed optimization should always be turned on. Because of the demands on
the stack , in many environments and applications it will have to be adjusted. 3
Regarding the necessary stack size for particular applications, one should note the
suggestion about the exponentiation functions in Chapter 6 and in the overview
on page 117. The stack requirements can be lessened by using the exponentiation
function with dynamic stack allocation as well as by the implementation of
dynamic registers (see Chapter 9).
The C functions and constants have been provided with the macros
__FLINT_API
Qualifier for C functions
__FLINT_API_A
Qualifier for assembler functions
__FLINT_API_DATA
Qualifier for constants
as in
extern int __FLINT_API add_l(CLINT, CLINT, CLINT);
extern USHORT __FLINT_API_DATA smallprimes[];
or, respectively, in the use of the assembler functions
extern int __FLINT_API_A div_l (CLINT, CLINT, CLINT, CLINT);
These macros are generally defined as empty comments /**/ . With their
aid, using the appropriate definitions, compiler- and linker-specific instructions
to functions and data can be made. If the assembler modules are used and not
3
With modern computers with virtual memory, except in the case of DOS, one usually does not
have to worry about this point, in particular with Unix or Linux systems.
 
Search WWH ::




Custom Search