mbedtls_cipher_info_t
cipher.h
const char * const char* mbedtls_cipher_info_t::private_name private_name mbedtls_cipher_info_t::private_name

Name of the cipher.

unsigned int unsigned int mbedtls_cipher_info_t::private_block_size private_block_size mbedtls_cipher_info_t::private_block_size 5

The block size, in bytes.

unsigned int unsigned int mbedtls_cipher_info_t::private_iv_size private_iv_size mbedtls_cipher_info_t::private_iv_size 3

IV or nonce size, in bytes (right shifted by MBEDTLS_IV_SIZE_SHIFT). For ciphers that accept variable IV sizes, this is the recommended size.

unsigned int unsigned int mbedtls_cipher_info_t::private_key_bitlen private_key_bitlen mbedtls_cipher_info_t::private_key_bitlen 4

The cipher key length, in bits (right shifted by MBEDTLS_KEY_BITLEN_SHIFT). This is the default length for variable sized ciphers. Includes parity bits for ciphers like DES.

unsigned int unsigned int mbedtls_cipher_info_t::private_mode private_mode mbedtls_cipher_info_t::private_mode 4

The cipher mode (as per mbedtls_cipher_mode_t). For example, MBEDTLS_MODE_CBC.

unsigned int unsigned int mbedtls_cipher_info_t::private_type private_type mbedtls_cipher_info_t::private_type 8

Full cipher identifier (as per mbedtls_cipher_type_t). For example, MBEDTLS_CIPHER_AES_256_CBC.

This could be 7 bits, but 8 bits retains byte alignment for the next field, which reduces code size to access that field.

unsigned int unsigned int mbedtls_cipher_info_t::private_flags private_flags mbedtls_cipher_info_t::private_flags 2

Bitflag comprised of MBEDTLS_CIPHER_VARIABLE_IV_LEN and MBEDTLS_CIPHER_VARIABLE_KEY_LEN indicating whether the cipher supports variable IV or variable key sizes, respectively.

unsigned int unsigned int mbedtls_cipher_info_t::private_base_idx private_base_idx mbedtls_cipher_info_t::private_base_idx 5

Index to LUT for base cipher information and functions.

Cipher information. Allows calling cipher functions in a generic way.

The library does not support custom cipher info structures, only built-in structures returned by the functions mbedtls_cipher_info_from_string(), mbedtls_cipher_info_from_type(), mbedtls_cipher_info_from_values(), mbedtls_cipher_info_from_psa().

Some fields store a value that has been right-shifted to save code-size, so should not be used directly. The accessor functions adjust for this and return the "natural" value.

- mbedtls_cipher_info_t
  private_base_idx
- mbedtls_cipher_info_t
  private_block_size
- mbedtls_cipher_info_t
  private_flags
- mbedtls_cipher_info_t
  private_iv_size
- mbedtls_cipher_info_t
  private_key_bitlen
- mbedtls_cipher_info_t
  private_mode
- mbedtls_cipher_info_t
  private_name
- mbedtls_cipher_info_t
  private_type