![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/9/c4/9c4432ed-94b6-4f82-9d47-c9fb5f98b613/9c4432ed-94b6-4f82-9d47-c9fb5f98b613-bg165.png)
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 for 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 BDEMO’s main function, menu interpreter, and drivers for
each of the menu commands. This file uses the standard C library functions
such as
printf and fopen, etc.
bdemodss.c
This file contains BDEMODSA’s main function. It is entirely analogous to
bdemo.c.
bdemoec.c
This file contains BDEMOEC’s 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 to interface to
the Crypto-C cryptographic library. The routines are written in straightforward,
easy-to-read portable C code. These routines also illustrate 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 application. 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-C’s
implementation of the Digital Signature Algorithm.
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 access 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.