wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
sha256.h
Go to the documentation of this file.
1#ifndef QUIC_HASH_SHA256_H
2#define QUIC_HASH_SHA256_H
3
5
10
11#define QUIC_SHA256_DIGEST 32
12#define QUIC_SHA256_BLOCK 64
13
24
31
39void quic_sha256_update(quic_sha256_ctx* s, const u8* data, usz len);
40
48
56void quic_sha256(const u8* data, usz len, u8 out[QUIC_SHA256_DIGEST]);
57
58#endif
void quic_sha256_final(quic_sha256_ctx *s, u8 out[QUIC_SHA256_DIGEST])
Finish the hash and write the digest.
#define QUIC_SHA256_BLOCK
internal block length in bytes
Definition sha256.h:12
void quic_sha256_update(quic_sha256_ctx *s, const u8 *data, usz len)
Absorb data[0..len) into the running hash.
#define QUIC_SHA256_DIGEST
digest length in bytes
Definition sha256.h:11
void quic_sha256_init(quic_sha256_ctx *s)
Reset s to the initial SHA-256 state.
void quic_sha256(const u8 *data, usz len, u8 out[QUIC_SHA256_DIGEST])
One-shot convenience: digest of data[0..len).
Streaming SHA-256 state.
Definition sha256.h:18
u8 buf[QUIC_SHA256_BLOCK]
partial-block staging buffer
Definition sha256.h:21
usz buf_len
bytes pending in buf
Definition sha256.h:22
u64 total
total bytes absorbed
Definition sha256.h:20
u32 h[8]
running hash state
Definition sha256.h:19
x86_64 Linux direct syscalls.
unsigned int u32
unsigned 32-bit integer
Definition syscall.h:14
u64 usz
unsigned size (size_t equivalent)
Definition syscall.h:19
unsigned char u8
unsigned 8-bit integer / byte
Definition syscall.h:17
unsigned long u64
unsigned 64-bit integer
Definition syscall.h:12