The X9.31 Sample Program

Printing the Buffer Contents

The following procedure prints the current contents of the buffer.

/* This procedure will print out what’s in the buffer. */

void PrintBuf (buffer, bufferLen) unsigned char *buffer; unsigned int bufferLen;

{

unsigned int i;

for (i = 0; i < bufferLen; ++i) {

if ( ((i & 7) == 7) (i == (bufferLen - 1)) ) printf (" %02x\n", buffer[i]);

else

printf (" %02x", buffer[i]);

}

printf ("\n");

} /* end PrintBuf */

3 2 6

R S A B S A F E C r y p t o - C D e v e l o p e r ’s G u i d e

Page 348
Image 348
RSA Security 5.2.2 manual Printing the Buffer Contents