2. CMOX_CBC

2.1. CBC single-call algorithms

group CMOX_CBC_ALGO

Variables

const cmox_cipher_algo_t CMOX_AESSMALL_CBC_ENC_ALGO

Identifier of the CBC encryption using AES (small implementation) for single-call function (Defined internally).

const cmox_cipher_algo_t CMOX_AESSMALL_CBC_DEC_ALGO

Identifier of the CBC decryption using AES (small implementation) for single-call function (Defined internally).

const cmox_cipher_algo_t CMOX_AESFAST_CBC_ENC_ALGO

Identifier of the CBC encryption using AES (fast implementation) for single-call function (Defined internally).

const cmox_cipher_algo_t CMOX_AESFAST_CBC_DEC_ALGO

Identifier of the CBC decryption using AES (fast implementation) for single-call function (Defined internally).

const cmox_cipher_algo_t CMOX_SM4_CBC_ENC_ALGO

Identifier of the CBC encryption using SM4 for single-call function (Defined internally).

const cmox_cipher_algo_t CMOX_SM4_CBC_DEC_ALGO

Identifier of the CBC decryption using SM4 for single-call function (Defined internally).

2.2. CBC implementations

group CMOX_CBC_IMPL

Variables

const cmox_cbc_impl_t CMOX_AESFAST_CBC_ENC

Implementation of CBC encryption using AES (fast implementation) (Defined internally).

const cmox_cbc_impl_t CMOX_AESFAST_CBC_DEC

Implementation of CBC decryption using AES (fast implementation) (Defined internally).

const cmox_cbc_impl_t CMOX_AESSMALL_CBC_ENC

Implementation of CBC encryption using AES (small implementation) (Defined internally).

const cmox_cbc_impl_t CMOX_AESSMALL_CBC_DEC

Implementation of CBC decryption using AES (small implementation) (Defined internally).

const cmox_cbc_impl_t CMOX_SM4_CBC_ENC

Implementation of CBC encryption using SM4 (Defined internally).

const cmox_cbc_impl_t CMOX_SM4_CBC_DEC

Implementation of CBC decryption using SM4 (Defined internally).

2.3. CBC public method prototypes

group CMOX_CBC_PUBLIC_METHODS

Functions

cmox_cipher_handle_t * cmox_cbc_construct ( cmox_cbc_handle_t * P_pThis , cmox_cbc_impl_t P_impl )

CBC constructor.

The function is used for specifying which block cipher algorithm to use in order to implement the CBC algorithm and if the algorithm will be used for encryption or decryption.

Parameters :
  • P_pThis – Pointer to the CBC handle to initialize

  • P_impl – Constant that specifies the implementation to use. This parameter can be one of the following values:

    • CMOX_AESFAST_CBC_ENC

    • CMOX_AESFAST_CBC_DEC

    • CMOX_AESSMALL_CBC_ENC

    • CMOX_AESSMALL_CBC_DEC

    • CMOX_SM4_CBC_ENC

    • CMOX_SM4_CBC_DEC

Returns :

cmox_cipher_handle_t* Pointer to a general cipher handle. This will be used by the general purpose cipher functions in order to perform the algorithm

2.4. CBC public types

group CMOX_CBC_PUBLIC_TYPES

Typedefs

typedef const struct cmox_cbc_implStruct_st * cmox_cbc_impl_t

CBC mode implementation.

This type specifies the used block cipher for the CBC construct and if the algorithm will be used for encryption or decryption. This type is defined as a pointer to a structure, that contains the functions needed for the specific implementation, defined in the library internally

struct cmox_cbc_handle_t
#include <cmox_cbc.h>

CBC handle structure definition.

Public Members

cmox_cipher_handle_t super

General cipher handle

cmox_blockcipher_handle_t blockCipher

Block cipher handle

uint32_t iv [ CMOX_CIPHER_BLOCK_SIZE ]

Buffer containing the Initialization Vector