Loading...
Searching...
No Matches
mbedtls_cipher_info_t Struct Reference

`#include <cipher.h>`

## Data Fields

const char * | private_name
unsigned int | private_block_size: 5
unsigned int | private_iv_size: 3
unsigned int | private_key_bitlen: 4
unsigned int | private_mode: 4
unsigned int | private_type: 8
unsigned int | private_flags: 2
unsigned int | private_base_idx: 5

## Detailed Description

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

Note
  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.

Definition at line 266 of file cipher.h.

## Field Documentation

## private_base_idx

unsigned int mbedtls_cipher_info_t::private_base_idx

Index to LUT for base cipher information and functions.

Definition at line 305 of file cipher.h.

## private_block_size

unsigned int mbedtls_cipher_info_t::private_block_size

The block size, in bytes.

Definition at line 271 of file cipher.h.

## private_flags

unsigned int mbedtls_cipher_info_t::private_flags

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.

Definition at line 302 of file cipher.h.

## private_iv_size

unsigned int mbedtls_cipher_info_t::private_iv_size

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.

Definition at line 277 of file cipher.h.

## private_key_bitlen

unsigned int mbedtls_cipher_info_t::private_key_bitlen

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.

Definition at line 283 of file cipher.h.

## private_mode

unsigned int mbedtls_cipher_info_t::private_mode

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

Definition at line 288 of file cipher.h.

## private_name

const char* mbedtls_cipher_info_t::private_name

Name of the cipher.

Definition at line 268 of file cipher.h.

## private_type

unsigned int mbedtls_cipher_info_t::private_type

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.

Definition at line 296 of file cipher.h.

The documentation for this struct was generated from the following file:

- cipher.h