# 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
…
- 79
- 80
- 81
- 82
- 83
…
- 119
- 120

cipherText The cipher text produced by the encryption. This buffer must
be at least numBytes long.
plainText The plain test to encrypt. Must be at least numBytes long.
numBytes The number of plain text bytes that must be encrypted.
authenticationTag Pointer to a structure to contain the authentication tag
generated by a series of authentications. The tag will be
written to this buffer when the user specifies the
BLOCK_CIPHER_OPTION_STREAM_COMPLETE option.
tagLen The length of the authentication tag, in bytes. 16 bytes is
standard. Shorter byte lengths can be used, but they provide
less reliable authentication.
key The key to use when encrypting/decrypting the data. The
format of this key will depend on the block cipher you are
using.
context Pointer to a context structure for this encryption. The first call
of this function should have the context->initializationVector
set to the initializationVector. The same context structure
instance should be used for every call used for the same
data stream. The contents of this structure should not be
changed by the user once the encryption/decryption has
started.
options Block cipher encryption options that the user can specify,
or'd together. If no option is specified then
BLOCK_CIPHER_OPTION_STREAM_CONTINUE is
assumed. Valid options for this function are
• BLOCK_CIPHER_OPTION_AUTHENTICATE_ONLY
• BLOCK_CIPHER_OPTION_STREAM_CONTINUE
• BLOCK_CIPHER_OPTION_STREAM_COMPLETE
Function
BLOCK_CIPHER_ERRORS BLOCK_CIPHER_GCM_Encrypt (DRV_HANDLE handle,
uint8_t * cipherText, uint8_t * plainText, uint32_t numBytes,
uint8_t * authenticationTag, uint8_t tagLen, void * key,
BLOCK_CIPHER_GCM_CONTEXT * context, uint32_t options)
1.7.1.7.5 BLOCK_CIPHER_GCM_Decrypt Function
Decrypts/authenticates plain text using Galois/counter mode.
File
block_cipher_mode_gcm.h
Syntax
BLOCK_CIPHER_ERRORS BLOCK_CIPHER_GCM_Decrypt(DRV_HANDLE handle, uint8_t * plainText,
uint8_t * cipherText, uint32_t numBytes, uint8_t * authenticationTag, uint8_t tagLen, void
* key, BLOCK_CIPHER_GCM_CONTEXT * context, uint32_t options);
Module
GCM
Returns
Returns a member of the BLOCK_CIPHER_ERRORS enumeration:
• BLOCK_CIPHER_ERROR_NONE - no error.
1.7 Library Interface MLA - Crypto Library Help Block Cipher Modes
81

- 1
- 2
…
- 79
- 80
- 81
- 82
- 83
…
- 119
- 120