1. CMOX_CTR_DRBG

1.1. CTR-DRBG implementations

group CMOX_CTR_DRBG_IMPL

Variables

const cmox_ctr_drbg_impl_t CMOX_CTR_DRBG_AES128_SMALL

Implementation of CTR-DRBG using AES-128 (small implementation) (Defined internally).

const cmox_ctr_drbg_impl_t CMOX_CTR_DRBG_AES128_FAST

Implementation of CTR-DRBG using AES-128 (fast implementation) (Defined internally).

const cmox_ctr_drbg_impl_t CMOX_CTR_DRBG_AES256_SMALL

Implementation of CTR-DRBG using AES-256 (small implementation) (Defined internally).

const cmox_ctr_drbg_impl_t CMOX_CTR_DRBG_AES256_FAST

Implementation of CTR-DRBG using AES-256 (fast implementation) (Defined internally).

1.2. CTR-DRBG public method prototypes

group CMOX_CTR_DRBG_PUBLIC_METHODS

Functions

cmox_drbg_handle_t * cmox_ctr_drbg_construct ( cmox_ctr_drbg_handle_t * P_pThis , cmox_ctr_drbg_impl_t P_impl )

CTR-DRBG constructor.

The function is used for specifying which block cipher algorithm to use in order to implement the CTR-DRBG algorithm

Parameters :
  • P_pThis – Pointer to the CTR-DRBG handle to initialize

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

    • CMOX_CTR_DRBG_AES128_FAST

    • CMOX_CTR_DRBG_AES192_FAST

    • CMOX_CTR_DRBG_AES256_FAST

    • CMOX_CTR_DRBG_AES128_SMALL

    • CMOX_CTR_DRBG_AES192_SMALL

    • CMOX_CTR_DRBG_AES256_SMALL

Returns :

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

1.3. CTR-DRBG public types

group CMOX_CTR_DRBG_PUBLIC_TYPES

Typedefs

typedef const struct cmox_ctr_drbg_implStruct_st * cmox_ctr_drbg_impl_t

CTR-DRBG mode implementation.

This type specifies the used block cipher for the CTR-DRBG construct. 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_ctr_drbg_state_t
#include <cmox_ctr_drbg.h>

Structure to store the state/context of the CTR_DRBG.

Public Members

uint32_t value [ 4 ]

V value, a 128 bit value

uint32_t key [ 8 ]

K value, contains the block cipher key

uint64_t reseed_counter

Reseed counter 32-bit of data

struct cmox_ctr_drbg_handle_t
#include <cmox_ctr_drbg.h>

CTR-DRBG handle structure definition.

Public Members

cmox_drbg_handle_t super

General DRBG handle

cmox_blockcipher_handle_t blockCipher

Block cipher handle

cmox_blockcipher_handle_t blockCipher_df

Block cipher handle for derivation function

cmox_ctr_drbg_state_t state

DRBG state

uint32_t flag

DRBG flag

cmox_cipher_keyLen_t keyLen

Length in bytes of the block cipher key

size_t expKeyLen

Length in bytes of the expanded key

size_t minEntropyLen

Minimum entropy length

size_t maxBytesPerRequest

Maximum number of random bytes per request

const uint32_t * exp_aes_0_key

Pointer to the expanded key

const uint32_t * exp_bcc_aes_key

Pointer to the expanded key for BCC