Interface to a SHA-512 implementation.
More...
#include <stddef.h>
#include <stdint.h>
Interface to a SHA-512 implementation.
◆ tinysha512_final()
void tinysha512_final |
( |
unsigned char * |
digest, |
|
|
sha512_state * |
s |
|
) |
| |
Computes the SHA-512 hash in the digest buffer.
- Note
- Assumes SHA512_DIGEST_SIZE bytes are available to accept the digest.
- Warning
- The state buffer 'leftover' is left in memory after processing. If your application intends to have sensitive data in this buffer, remember to erase it after the data has been processed
- Parameters
-
[out] | digest | The computed digest. Must be non-null or behavior is undefined. |
[in] | s | The hash state. Must be non-null or behavior is undefined. |
◆ tinysha512_init()
void tinysha512_init |
( |
sha512_state * |
s | ) |
|
The SHA state.
Initializes the hash state
- Parameters
-
[in,out] | s | The hash state to initialize. |
◆ tinysha512_update()
void tinysha512_update |
( |
sha512_state * |
s, |
|
|
void const * |
data, |
|
|
size_t |
data_length |
|
) |
| |
Hashes data into state using SHA-512.
- Warning
- The state buffer 'leftover' is left in memory after processing. If your application intends to have sensitive data in this buffer, remember to erase it after the data has been processed
- Parameters
-
[in,out] | s | The hash state. Must be non-null or behavior is undefined. |
[in] | data | The data to hash into s. |
[in] | data_length | The size of data in bytes. |