XYPRO Technology Corporation
129
Proprietary and Confidential
Appendix E: XDP API Procedures
A sample ‘C’ program is included in the XDP XYGATEDP installation subvolume named SDKSAMPC.
Please refer to that sample program for a complete example on how to use this SDK.
The following
#include
statements are required somewhere near the top of your program:
#include "xdpdecth (declarations)"
#include "encrdech (declarations)"
The following
#include
statements are required in the section of your program where you declare
external procedure references:
#include "xdpdecth (procedures)"
#include "encrdech (procedures)"
E1:
__XYPRO_ENCR_MEMBLK_SIZE
long __XYPRO_ENCR_MEMBLK_SIZE (void);
Returns the number bytes of memory needed by the Encryption API for context. The value returned
should be used to allocate memory for the Encryption context.
Example:
/* Global Storage */
char *encr_ctx = NULL; /* Encryption context pointer */
...
/* Local Storage */
long nmem_size;
nmem_size = __XYPRO_ENCR_MEMBLK_SIZE ();
encr_ctx = (char *) malloc (nmem_size);
E2:
__XYPRO_ENCR_SEND_BUF_SIZE
short __XYPRO_ENCR_SEND_BUF_SIZE (void);
Returns the number of memory bytes needed for the I/O buffer. A separate buffer needs to be allocated
for each outstanding encryption operation. The value returned should be used to allocate memory for
each I/O buffer.
Example:
/* Global Storage */
char *pbuffer = NULL; /* I/O buffer */
...
/* Local Storage */
long nmem_size;
nmem_size = (long) __XYPRO_ENCR_MEMBLK_SIZE ();
pbuffer = (char *) malloc (nmem_size);