# Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

### Protego

# MLA -- Crypto Library

1 January, 2012

- 1
- 2
…
- 41
- 42
- 43
- 44
- 45
…
- 119
- 120

1.7.1.3.1 BLOCK_CIPHER_CBC_CONTEXT Structure
File
block_cipher_mode_cbc.h
Syntax
typedef struct {
uint8_t initializationVector[CRYPTO_CONFIG_BLOCK_MAX_SIZE];
uint8_t remainingData[CRYPTO_CONFIG_BLOCK_MAX_SIZE];
uint32_t blockSize;
BLOCK_CIPHER_FunctionEncrypt encrypt;
BLOCK_CIPHER_FunctionDecrypt decrypt;
uint8_t bytesRemaining;
} BLOCK_CIPHER_CBC_CONTEXT;
Members
Members Description
uint8_t
initializationVector[CRYPTO_CONFIG_BLOCK_MAX_SIZE];
Initialization vector for the CBC operation
uint8_t
remainingData[CRYPTO_CONFIG_BLOCK_MAX_SIZE];
Buffer to store data until more is avaliable if there is not
enough to encrypt an entire block.
uint32_t blockSize; Block size of the cipher algorithm being used with the block
cipher mode module
BLOCK_CIPHER_FunctionEncrypt encrypt; Encrypt function for the algorithm being used with the block
cipher mode module
BLOCK_CIPHER_FunctionDecrypt decrypt; Decrypt function for the algorithm being used with the block
cipher mode module
uint8_t bytesRemaining; Number of bytes remaining in the remainingData buffer
Module
CBC
Description
Context structure for a cipher-block chaining operation
1.7.1.3.2 BLOCK_CIPHER_CBC_Initialize Function
Initializes a CBC context for encryption/decryption.
File
block_cipher_mode_cbc.h
Syntax
void BLOCK_CIPHER_CBC_Initialize(BLOCK_CIPHER_CBC_CONTEXT * context,
BLOCK_CIPHER_FunctionEncrypt encryptFunction, BLOCK_CIPHER_FunctionDecrypt decryptFunction,
uint32_t blockSize, uint8_t * initializationVector);
Module
CBC
Returns
None.
Description
Initializes a CBC context for encryption/decryption. The user will specify details about the algorithm being used in CBC mode.
Preconditions
Any required initialization needed by the block cipher algorithm must have been performed.
1.7 Library Interface MLA - Crypto Library Help Block Cipher Modes
43

- 1
- 2
…
- 41
- 42
- 43
- 44
- 45
…
- 119
- 120