gtpc2m0r | C/C++ Language Support User's Guide |
An ECB-controlled program calls the cifrc function whenever a portion of a message needs to be enciphered or deciphered. Calling the cifrc function causes the IBM-supplied cipher programs BQKCIPH or BQKDES to be executed.
Format
#include <tpfapi.h> void cifrc(int cipher_program, struct cifrc_arg *c_req);
Normal Return
Void. The text pointed to by ciftext has been replaced by the enciphered or deciphered text.
Error Return
Not applicable.
Programming Considerations
Examples
The following example enciphers the first 4 bytes of text starting at EBX000, using the 8-byte key at EBW000.
#include <tpfapi.h> /* storage for cifrc_arg */ struct cifrc_arg *reqptr = (struct cifrc_arg *) &(ecbptr()->ebw032);
·
·
·
reqptr->cifreqst = 0; /* Encipher the Text */ reqptr->cifkey = &(ecbptr()->ebw000); /* pointer to key in EBW000-007 */ reqptr->ciftext = &(ecbptr()->ebx000); /* text to be enciphered */ cifrc(CIFRC_AET, reqptr);
Related Information