Developer Reference

Contents

RSA Primitives

The functions described in this section refer to RSA primitives.
The application code for conducting a typical RSA encryption must perform the following sequence of operations, starting with building of a crypto system:
  1. Call the function
    RSA_GetSizePublicKey
    to get the size required to configure
    IppsRSAPublicKeyState
    context.
  2. Ensure that the required memory space is properly allocated. With the allocated memory, call the
    RSA_InitPublicKey
    function to initialize the context.
  3. Call
    RSA_SetPublicKey
    to set up RSA public key (
    n
    ,
    e
    ).
  4. Call the
    RSA_GetBufferSizePublicKey
    function to get the size of a temporary buffer.
  5. Invoke the
    RSA_Encrypt
    function with the established RSA public key to encode the plaintext into the respective ciphertext.
  6. Clean up secret data stored in the context.
  7. Free the memory allocated for the
    IppsRSAPublicKeyState
    context by calling the operating system memory free service function.
The typical application code for the RSA decryption must perform the following sequence of operations:
  1. Call the function
    GetSizePrivateKeyType1
    or
    RSA_GetSizePrivateKeyType2
    to get the size required to configure
    IppsRSAPrivateKeyState
    context.
  2. Ensure that the required memory space is properly allocated. With the allocated memory, call the
    InitPrivateKeyType1
    or
    RSA_InitPrivateKeyType2
    function to initialize the context.
  3. Call the
    RSA_GetBufferSizePrivateKey
    function to get the size of a temporary buffer.
  4. Establish the RSA private key by means of either the
    RSA_GenerateKeys
    function or by the key setup function
    RSA_SetPrivateKeyType1
    or
    RSA_SetPrivateKeyType2
    .
    The
    RSA_GenerateKeys
    function can generate both type 1 and type 2 private keys, while the choice of the key setup function depends on the representation of the private key you are using
    .
  5. Invoke the
    RSA_Decrypt
    function with the established RSA public key to decode the ciphertext into the respective plaintext.
  6. Clean up secret data stored in the context.
  7. Free the memory allocated for the
    IppsRSAPrivateKeyState
    context by calling the operating system memory free service function.
You can perform up to 8 encryption/decryption operations at once using the RSA_MB_Encrypt and RSA_MB_Decrypt functions. For this, repeat steps 2-4 to set up the required number of keys, and then repeat steps 6-7 for each initialized context.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804