# 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
…
- 48
- 49
- 50
- 51
- 52
…
- 119
- 120

Syntax
void BLOCK_CIPHER_CFB_Initialize(BLOCK_CIPHER_CFB_CONTEXT * context,
BLOCK_CIPHER_FunctionEncrypt encryptFunction, BLOCK_CIPHER_FunctionDecrypt decryptFunction,
uint32_t blockSize, uint8_t * initializationVector);
Module
CFB
Returns
None.
Description
Initializes a CFB context for encryption/decryption. The user will specify details about the algorithm being used in CFB mode.
Preconditions
Any required initialization needed by the block cipher algorithm must have been performed.
Example
// Initialize the CFB block cipher module for use with AES.
SYS_MODULE_OBJ sysObject;
DRV_HANDLE handle;
BLOCK_CIPHER_CFB_CONTEXT context;
// Initialization vector for CFB mode
static uint8_t initialization_vector[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f};
sysObject = DRV_AES_Initialize (DRV_AES_INDEX, NULL);
if (sysObject != SYS_MODULE_OBJ_STATIC)
{
// error
}
handle = DRV_AES_Open (DRV_AES_INDEX, 0);
if (handle != DRV_AES_HANDLE)
{
// error
}
// Initialize the block cipher module
BLOCK_CIPHER_CFB_Initialize (&context, AES_Encrypt, AES_Decrypt, AES_BLOCK_SIZE,
initialization_vector);
Parameters
Parameters Description
context The CFB context to initialize.
encryptFunction Pointer to the encryption function for the block cipher
algorithm being used in CFB mode.
decryptFunction Pointer to the decryption function for the block cipher
algorithm being used in CFB mode.
blockSize The block size of the block cipher algorithm being used in
CFB mode.
initializationVector The initialization vector for this operation. The length of this
vector must be equal to the block size of your block cipher.
Function
void BLOCK_CIPHER_CFB_Initialize ( BLOCK_CIPHER_CFB_CONTEXT * context,
BLOCK_CIPHER_FunctionEncrypt encryptFunction,
BLOCK_CIPHER_FunctionDecrypt decryptFunction, uint32_t blockSize,
uint8_t * initialization_vector)
1.7 Library Interface MLA - Crypto Library Help Block Cipher Modes
50

- 1
- 2
…
- 48
- 49
- 50
- 51
- 52
…
- 119
- 120