
BSLite
336 RSA BSAFE Crypto-C Developer’s Guide
BSLite
BSLite is a collection of routines that interface with the Crypto-C library. BSLite
demonstrates how to call Crypto-C to execute various cryptographic procedures. The
routines are written in straightforward, easy-to-read portable C and is provided to all
Crypto-C customers in source form. BSLite includes a number of the most popular
functions supported by the Crypto-C library:
• Symmetric key generation
• Symmetric block and stream encryption
• Diffie-Hellman parameter generation
• Diffie-Hellman key agreement
• Message digest computation
• RSA key generation
• RSA digital signature creation and verification
• RSA digital envelope sealing and opening
• Password-based private key protection/encryption
fbslec.c,
fbslec.h,
fileio.c
and
fileio.h
These files are used by BDEMOEC. These files call on the routines in bslec.c
and handle the file I/O for each operation. These files use the standard C library
functions such as
printf and fopen. The files fbslec.c and fbslec.h
are analogous to filebsl.c and filebsl.h used by BDEMO.
tstdlib.c
This file contains memory, I/O, and buffer manipulation routines needed by
Crypto-C, such as
T_malloc and T_memcmp. This file illustrates how these
routines can be implemented on most platforms. However, some of these
routines may need alteration for different platforms. For example, Crypto-C
requires that
T_free perform no function if it is passed NULL_PTR, but some
library implementations of
free may not satisfy this convention. Therefore, an
explicit check for
NULL_PTR may be needed in T_free.
tstdlib.c uses the constant MEMMOVE_PRESENT. If the platform’s C library
provides
memmove, MEMMOVE_PRESENT should be defined as 1; otherwise, it
should be defined as 0. In
tstdlib.c, default values are given for these
constants, but they may be overridden by a compiler flag. For example:
-DMEMMOVE_PRESENT=0
Table A-1 Demo Program Source Files
File(s) Description