|
wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
|
FIPS 180-4 SHA-256. More...
#include "common/platform/sys/syscall.h"Go to the source code of this file.
Data Structures | |
| struct | quic_sha256_ctx |
| Streaming SHA-256 state. More... | |
Macros | |
| #define | QUIC_SHA256_DIGEST 32 |
| digest length in bytes | |
| #define | QUIC_SHA256_BLOCK 64 |
| internal block length in bytes | |
Functions | |
| void | quic_sha256_init (quic_sha256_ctx *s) |
| Reset s to the initial SHA-256 state. | |
| void | quic_sha256_update (quic_sha256_ctx *s, const u8 *data, usz len) |
| Absorb data[0..len) into the running hash. | |
| void | quic_sha256_final (quic_sha256_ctx *s, u8 out[QUIC_SHA256_DIGEST]) |
| Finish the hash and write the digest. | |
| void | quic_sha256 (const u8 *data, usz len, u8 out[QUIC_SHA256_DIGEST]) |
| One-shot convenience: digest of data[0..len). | |
FIPS 180-4 SHA-256.
Produces a 32-byte digest.
One-shot convenience: digest of data[0..len).
| data | bytes to hash |
| len | number of bytes at data |
| out | receives the 32-byte digest |
| void quic_sha256_final | ( | quic_sha256_ctx * | s, |
| u8 | out[QUIC_SHA256_DIGEST] ) |
Finish the hash and write the digest.
| s | context to finalize (its state is consumed) |
| out | receives the 32-byte digest |
| void quic_sha256_init | ( | quic_sha256_ctx * | s | ) |
Reset s to the initial SHA-256 state.
| s | context to initialize |
| void quic_sha256_update | ( | quic_sha256_ctx * | s, |
| const u8 * | data, | ||
| usz | len ) |
Absorb data[0..len) into the running hash.
| s | context previously initialized |
| data | bytes to absorb |
| len | number of bytes at data |