RC5* Functions

RC5, introduced by R.Rivest, is a fast symmetric block cipher that has a variable block size, variable key length, variable number of rounds and heavily uses data-independent rotations. Intel IPP for Cryptography implements functions for RC5 algorithm with 64- and 128-bit block sizes.

This section describes functions for various operational modes of RC5 cipher systems. The functions are implemented to comply with the RC5 cipher schemes documented in [RC5].

Table “Intel IPP RC5 Functions” lists Intel IPP RC5 functions.

Intel IPP RC5 Functions  
Function Base Name Operation
Functions for 64-bit Block Size
ARCFive64GetSize Gets the size of the IppsARCFive64Speccontext.
ARCFive64Init Initializes user-supplied memory as the IppsARCFive64Spec context for future use.
ARCFive64Pack, ARCFive64Unpack Packs/unpacks the ARCFive64Spec context into/from a user-defined buffer.
ARCFive64EncryptECB Encrypts a variable length data stream using the RC5 cipher with 64-bit block size in the ECB mode.
ARCFive64DecryptECB Decrypts a variable length data stream using the RC5 cipher with 64-bit block size in the ECB mode.
ARCFive64EncryptCBC Encrypts a variable length data stream using the RC5 cipher with 64-bit block size in the CBC mode.
ARCFive64DecryptCBC Decrypts a variable length data stream using the RC5 cipher with 64-bit block size in the CBC mode.
ARCFive64EncryptCFB Encrypts a variable length data stream using the RC5 cipher with 64-bit block size in the CFB mode.
ARCFive64DecryptCFB Decrypts a variable length data stream using the RC5 cipher with 64-bit block size in the CFB mode.
ARCFive64EncryptOFB Encrypts a variable length data stream using the RC5 cipher with 64-bit block size in the OFB mode.
ARCFive64DecryptOFB Decrypts a variable length data stream using the RC5 cipher with 64-bit block size in the OFB mode.
ARCFive64EncryptCTR Encrypts a variable length data stream using the RC5 cipher with 64-bit block size in the CTR mode.
ARCFive64DecryptCTR Decrypts a variable length data stream using the RC5 cipher with 64-bit block size in the CTR mode.
Functions for 128-bit Block Size
ARCFive128GetSize Gets the size of the IppsARCFive128Spec context.
ARCFive128Init Initializes user-supplied memory as the IppsARCFive128Spec context for future use.
ARCFive128Pack/ARCFive128Unpack Packs/unpacks the ARCFive128Spec context into/from a user-defined buffer.
ARCFive128EncryptECB Encrypts a variable length data stream using the RC5 cipher with 128-bit block size in the ECB mode.
ARCFive128DecryptECB Decrypts a variable length data stream using the RC5 cipher with 128-bit block size in the ECB mode.
ARCFive128EncryptCBC Encrypts a variable length data stream using the RC5 cipher with 128-bit block size in the CBC mode.
ARCFive128DecryptCBC Decrypts a variable length data stream using the RC5 cipher with 128-bit block size in the CBC mode.
ARCFive128EncryptCFB Encrypts a variable length data stream using the RC5 cipher with 128-bit block size in the CFB mode.
ARCFive128DecryptCFB Decrypts a variable length data stream using the RC5 cipher with 128-bit block size in the CFB mode.
ARCFive128EncryptOFB Encrypts a variable length data stream using the RC5 cipher with 128-bit block size in the OFB mode.
ARCFive128DecryptOFB Decrypts a variable length data stream using the RC5 cipher with 128-bit block size in the OFB mode.
ARCFive128EncryptCTR Encrypts a variable length data stream using the RC5 cipher with 128-bit block size in the CTR mode.
ARCFive128DecryptCTR Decrypts a variable length data stream using the RC5 cipher with 128-bit block size in the CTR mode.

Throughout this section, the functions for the RC5 cipher with 64-bit block size employ the context IppsARCFive64Spec and the functions for the RC5 cipher with 128-bit block size employ the context IppsARCFive128Spec. These contexts serve as operational vehicles to carry variables needed to accomplish RC5 encryption/decryption, namely the number of rounds and expanded key table S.

Once the respective initialization function generates these variables, the functions for ECB, CBC, CFB, and other modes are ready for either encrypting or decrypting the streaming data with the specified padding scheme.

The application code for conducting a typical encryption in the CBC mode using the RC5 cipher with 64-bit block size should follow the sequence of operations outlined below:


  1. Get the size required to configure the context IppsARCFive64Spec by calling the function ARCFive64GetSize.
  2. Allocate a buffer whose size is not less than the function ARCFive64GetSize returns by calling the memory allocation service function of the operating system.
  3. Initialize the context IppsARCFive64Spec *pCtx by calling the function ARCFive64Init with the allocated buffer and the respective RC5 cipher key of the specified size.
  4. Specify the initialization vector and the padding scheme and then call the function ARCFive64EncryptCBC to encrypt the input data stream using the RC5 cipher in the CBC mode.
  5. Release the memory allocated to the buffer by calling the respective operating system function.

Note iconNote

Similar procedure can be applied for ECB, CFB, OFB, and CTR modes of operation as well as the RC5 cipher with 128-bit block size.

The ARCFive64Spec and ARCFive128Spec contexts are position-dependent. The ARCFive64Pack/ARCFive64Unpack and ARCFive128Pack/ARCFive128Unpack functions transform the respective position-dependent context to a position-independent form and vice versa.


Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.