|
ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
|
SHA-1 (FIPS 180-4) - one-shot digest. More...
#include "protocore_config.h"Go to the source code of this file.
Classes | |
| struct | Sha1Ns |
| Dispatch table. Addressed by offset, so the layout is asserted below. More... | |
Macros | |
| #define | PROTOCORE_SHA1_DIGEST_LEN 20 |
| SHA-1 digest length in bytes. | |
Functions | |
| PROTOCORE_NS_LAYOUT (Sha1Ns, hash) | |
| proto_bool | protocore_sha1_hash (uint8_t *work, const uint8_t *data, size_t len, uint8_t *out) |
| Digest the whole message in one call. | |
Variables | |
| PROTOCORE_NS Sha1Ns Sha1 | PROTOCORE_UNUSED = {.hash = protocore_sha1_hash} |
| Module namespace. | |
SHA-1 (FIPS 180-4) - one-shot digest.
The shared SHA-1 primitive. On Arduino (ESP32) delegates to the hardware SHA accelerator; on native builds a portable software implementation is used. Used for the WebSocket opening handshake (RFC 6455 ยง4.2.2) and other legacy digest needs. Output is always 20 bytes.
work is PROTOCORE_SHA1_BORROW secure bytes the CALLER took, at an address it knows. It is not held past the call, so nothing here aliases it. The caller releases it, and the pool wipes on release; this module neither takes it, holds it, releases it, nor wipes it.
Definition in file sha1.h.
| #define PROTOCORE_SHA1_DIGEST_LEN 20 |
| PROTOCORE_NS_LAYOUT | ( | Sha1Ns | , |
| hash | |||
| ) |
| proto_bool protocore_sha1_hash | ( | uint8_t * | work, |
| const uint8_t * | data, | ||
| size_t | len, | ||
| uint8_t * | out | ||
| ) |
Digest the whole message in one call.
| work | PROTOCORE_SHA1_BORROW bytes the caller took. Not held past the call. |
| data | the bytes |
| len | how many |
| out | PROTOCORE_SHA1_DIGEST_LEN bytes |
| PROTOCORE_NS Sha1Ns Sha1 PROTOCORE_UNUSED = {.hash = protocore_sha1_hash} |