Vault 7: Projects
This publication series is about specific projects related to the Vault 7 main publication.
SHA1_CONTEXT context;
SHA1_Initialize (&context, buffer);
Parameters
Parameters Description
context The context to initialize.
workingBuffer A working buffer used by the module to calculate the hash. If
the CRYPTO_HASH_CONFIG_SHA_SMALL_RAM macro is
defined in sha_config.h, this buffer must contain 16 uint32_t
words. Otherwise, this buffer must contain 80 32-bit words,
but performance will be slightly improved.
Function
void SHA1_Initialize( SHA1_CONTEXT* context, uint8_t * workingBuffer);
1.6.2.3 SHA1_DataAdd Function
Adds data to a hash being calculated.
File
sha1.h
Syntax
void SHA1_DataAdd(SHA1_CONTEXT* context, uint8_t * data, uint16_t len);
Module
SHA-1
Returns
None.
Description
This routine adds data to a SHA-1 hash being calculated. When the data length reaches a block size (64 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 SHA1_Initialize.
Example
// Initialization for CRYPTO_HASH_CONFIG_SHA_SMALL_RAM
uint8_t data[] = "Hello.";
uint32_t buffer[16];
SHA1_CONTEXT context;
SHA1_Initialize (&context, buffer);
SHA1_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 SHA1_DataAdd ( SHA1_CONTEXT* context, uint8_t * data, uint16_t len);
1.6 Library Interface MLA - Crypto Hash Library Help SHA-1
15
1
Protego_Release_01_05-Related-OEM-Documentation-MLA_v2013_12_20-help_mla_crypto_hash.pdf