AI_RC6_CBCPad

AI_RC6_CBCPad

Purpose:

This AI allows you to perform RC6 encryption and decryption in CBC mode with a 16-byte initialization vector and 20 rounds, as defined in the AES submission. This algorithm pads, so the total number of input bytes does not have to be a multiple of 16 bytes.

Type of information this allows you to use:

a rounds count (currently only 20 is a valid round count), and a 16-byte initialization vector for the RC6 CBC encryption algorithm.

Format of info supplied to B_SetAlgorithmInfo:

pointer to an A_RC6_CBC_PARAMS structure:

typedef struct

{

 

unsigned int

rounds;

/* number of rounds (20) */

unsigned char *iv; /* initialization vector (16 bytes) */ } A_RC6_CBC_PARAMS;

Note: Although one of the parameters is number of rounds, Crypto-C currently accepts only 20. Future versions may accept other round counts.

Format of info returned by B_GetAlgorithmInfo:

pointer to an A_RC6_CBC_PARAMS structure (see above).

Crypto-C procedures to use with algorithm object:

B_EncryptInit, B_EncryptUpdate, B_EncryptFinal, B_DecryptInit,

B_DecryptUpdate, and B_DecryptFinal. You may pass (B_ALGORITHM_OBJ)NULL_PTR for all randomAlgorithm arguments.

Algorithm methods to include in application’s algorithm chooser:

AM_RC6_CBC_ENCRYPT for encryption and AM_RC6_CBC_DECRYPT for decryption.

2 0 4

R S A B S A F E C r y p t o - C L i b r a r y R e f e r e n c e M a n u a l

Page 214
Image 214
RSA Security 5 manual AIRC6CBCPad, Pointer to an ARC6CBCPARAMS structure