BearSSL
Data Fields
br_block_cbcenc_class Struct Reference

Class type for CBC encryption implementations. More...

Data Fields

size_t context_size
 Size (in bytes) of the context structure appropriate for containing subkeys. More...
 
unsigned block_size
 Size of individual blocks (in bytes). More...
 
unsigned log_block_size
 Base-2 logarithm of the size of individual blocks, expressed in bytes. More...
 
void(* init )(const br_block_cbcenc_class **ctx, const void *key, size_t key_len)
 Initialisation function. More...
 
void(* run )(const br_block_cbcenc_class *const *ctx, void *iv, void *data, size_t len)
 Run the CBC encryption. More...
 

Detailed Description

Class type for CBC encryption implementations.

A br_block_cbcenc_class instance points to the functions implementing a specific block cipher, when used in CBC mode for encrypting data.

Field Documentation

◆ block_size

unsigned br_block_cbcenc_class::block_size

Size of individual blocks (in bytes).

◆ context_size

size_t br_block_cbcenc_class::context_size

Size (in bytes) of the context structure appropriate for containing subkeys.

◆ init

void(* br_block_cbcenc_class::init) (const br_block_cbcenc_class **ctx, const void *key, size_t key_len)

Initialisation function.

This function sets the vtable field in the context structure. The key length MUST be one of the key lengths supported by the implementation.

Parameters
ctxcontext structure to initialise.
keysecret key.
key_lenkey length (in bytes).

◆ log_block_size

unsigned br_block_cbcenc_class::log_block_size

Base-2 logarithm of the size of individual blocks, expressed in bytes.

◆ run

void(* br_block_cbcenc_class::run) (const br_block_cbcenc_class *const *ctx, void *iv, void *data, size_t len)

Run the CBC encryption.

The iv parameter points to the IV for this run; it is updated with a copy of the last encrypted block. The data is encrypted "in place"; its length (len) MUST be a multiple of the block size.

Parameters
ctxcontext structure (already initialised).
ivIV for CBC encryption (updated).
datadata to encrypt.
lendata length (in bytes, multiple of block size).

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