A type that holds the context for an ongoing SHA-512 operation. More...
#include <sw/device/lib/crypto/impl/sha2/sha512.h>
Data Fields | |
uint32_t | H [kSha512StateWords] |
Working state for a SHA-512 or SHA-384 computation. | |
uint32_t | partial_block [kSha512MessageBlockWords] |
Partial block, if any. More... | |
sha512_message_length_t | total_len |
Total message length so far, in bits. | |
A type that holds the context for an ongoing SHA-512 operation.
IMPORTANT: Every member of this struct should be a word-aligned type and have a size divisible by sizeof(uint32_t)
; otherwise sha512_state_t
will not be suitable for hardened_memcpy()
.
uint32_t sha512_state::H[kSha512StateWords] |
uint32_t sha512_state::partial_block[kSha512MessageBlockWords] |
Partial block, if any.
If we get an update() with a message that isn't an even number of blocks, there's no way to know if we should pad it or not until we get the next update() or final(). The length of actual data in this block is always (total_len % kSha512MessageBlockBytes) bytes.
sha512_message_length_t sha512_state::total_len |