# Vault 7: Projects

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

### Protego

# MLA -- Crypto Hash Library

20 December, 2013

- 1
- 2
…
- 21
- 22
- 23
- 24
- 25

Module
SHA-512
Returns
None.
Description
This routine adds data to a SHA-512 hash being calculated. When the data length reaches a block size (128 bytes), this
function will calculate the hash over that block and store the current hash value in the hash context.
Remarks
None.
Preconditions
The hash context must be initialized with SHA512_Initialize.
Example
// Initialization for CRYPTO_HASH_CONFIG_SHA_SMALL_RAM
uint8_t data[] = "Hello.";
uint64_t buffer[16];
SHA512_CONTEXT context;
SHA512_Initialize (&context, SHA2_512, buffer);
SHA512_DataAdd (&context, data, 6);
Parameters
Parameters Description
context The context of the hash being calculated.
data The data being added.
len The length of the data being added.
Function
void SHA512_DataAdd ( SHA512_CONTEXT * context, uint8_t * data, uint32_t len);
1.6.4.5 SHA512_Calculate Function
Finishes calculating a hash.
File
sha512.h
Syntax
void SHA512_Calculate(SHA512_CONTEXT * context, uint8_t * result);
Module
SHA-512
Returns
None.
Description
This routine finishes calculating a SHA-512 hash. It will automatically add the padding required by the hashing algorithm and
return the hash digest.
Remarks
None.
1.6 Library Interface MLA - Crypto Hash Library Help SHA-512
23
1

- 1
- 2
…
- 21
- 22
- 23
- 24
- 25