Appendix A Command-Line Demos 335

File Reference

File Reference

The C source code files for the demo programs provide a convenient means to learn

Crypto-C by example and are a good starting point fo r your own Crypto-C

applications.

The source files for the demo programs are described in Table A-1.

Table A-1 Demo Program Source Files
File(s) Description
bdemo.c This file contains BDEMOs main function, menu interpreter, and drivers for
each of the menu commands. This file uses the standard C library functi ons
such as printf and fopen, etc.
bdemodss.c This file contains BDEMODSAs main function. It is entirely analogous to
bdemo.c.
bdemoec.c This file contains BDEMOECs main function. It is entirely analogous to
bdemo.c. The elliptic curve parameters used for this demonstration, along with
two key pairs, are hard-coded in the beginning of this file.
bslite.c and
bslite.h
bslite.c contains a collection of routines that enable BDEMO t o interface to
the Crypto-C cryptographic library. The routines are written in straigh tforward,
easy-to-read portable C code. These routines also illustrat e the coding of
interfaces to a number of common Crypto-C library functions. A developer may
wish use this module as a starting point for developing an applicat ion. Refer to
blreadme (in the demosrc directory) for extended descriptions of routines
contained in bslite.c.
bsliteds.c and
bsliteds.h
bsliteds.c contains routines used by BDEMODSA to interface to the Crypto-
C library. These routines illustrate how to code portable interfaces to Crypto-Cs
implementation of the Digital Signature Algorit hm.
bslec.c and
bslec.h
bslec.c contains routines used by BDEMOEC to interface to the Crypto-C
library. These routines are analogous to bslite.c and bslite.h. However,
not all functions in bslite.c have a counterpart in bslec.c.
choosc.c and
demochos.h
These files define the DEMO_ALGORITHM_CHOOSER which may be used as a
default for the algorithmChooser argument to Crypto-C routines.
DEMO_ALGORITHM_CHOOSER is externally declared in demochos.h for
inclusion by applications that need acces s to the
DEMO_ALGORITHM_CHOOSER.
filebsl.c,
filebsl.h,
fileio.c and
fileio.h
These files call on the BSLite routines in bslite.c and handle the file I/O for
each operation. These files use the standard C library functions such as
printf and fopen.