# 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
…
- 112
- 113
- 114
- 115
- 116
…
- 119
- 120

Parameters
Parameters Description
handle The handle of the opened client instance
cipherText A pointer to a buffer that will hold the encrypted message
plainText A pointer to the buffer containing the message to be
encrypted
msgLen The length of the message to be encrypted
publicKey A pointer to a structure containing the public key
Function
DRV_RSA_STATUS DRV_RSA_Encrypt (DRV_HANDLE handle, uint8_t *cipherText,
uint8_t *plainText, int msgLen,
const DRV_RSA_PUBLIC_KEY *publicKey)
1.7.6.20 DRV_RSA_Decrypt Function
Decrypts a message using a private RSA key
File
rsa.h
Syntax
DRV_RSA_STATUS DRV_RSA_Decrypt(DRV_HANDLE handle, uint8_t * plainText, uint8_t *
cipherText, uint16_t * msgLen, const DRV_RSA_PRIVATE_KEY_CRT * privateKey);
Module
RSA
Returns
Driver status. If running in blocking mode, the function will return DRV_RSA_STATUS_READY after a successful decryption
operation. If running in non-blocking mode, the driver will start the decryption operation and return immediately with
DRV_RSA_STATUS_BUSY.
Description
This routine decrypts a message using a private RSA key.
Remarks
The plainText and cipherText buffers must be at least as large as the key size
The message length must not be greater than the key size
Preconditions
Driver must be opened by a client.
Parameters
Parameters Description
handle The handle of the opened client instance
plainText A pointer to a buffer that will hold the decrypted message
cipherText A pointer to a buffer containing the message to be decrypted
msgLen The length of the message that was decrypted
privateKey A pointer to a structure containing the public key
Function
DRV_RSA_STATUS DRV_RSA_Decrypt (DRV_HANDLE handle, uint8_t *plainText,
1.7 Library Interface MLA - Crypto Library Help RSA
114

- 1
- 2
…
- 112
- 113
- 114
- 115
- 116
…
- 119
- 120