|
ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
|
SHA-512 (FIPS 180-4) - streaming context and one-shot API. More...
#include <stddef.h>#include <stdint.h>#include <mbedtls/sha512.h>Go to the source code of this file.
Classes | |
| struct | pc_sha512_ctx |
| Streaming SHA-512 context. More... | |
Macros | |
| #define | PC_SHA512_DIGEST_LEN 64 |
| SHA-512 digest length in bytes. | |
| #define | PC_SHA512_BLOCK_LEN 128 |
| SHA-512 block size in bytes. | |
Functions | |
| void | pc_sha512_init (pc_sha512_ctx *ctx) |
Initialize a streaming SHA-512 context (ctx must not be NULL). | |
| void | pc_sha512_update (pc_sha512_ctx *ctx, const uint8_t *data, size_t len) |
Feed len bytes of data into the running hash. | |
| void | pc_sha512_final (pc_sha512_ctx *ctx, uint8_t digest[PC_SHA512_DIGEST_LEN]) |
| Finalize the hash and write the 64-byte digest. The context is undefined afterwards; call init() again before reuse. | |
| void | pc_sha512 (const uint8_t *data, size_t len, uint8_t digest[PC_SHA512_DIGEST_LEN]) |
One-shot SHA-512: hash len bytes of data into digest (64 bytes). | |
SHA-512 (FIPS 180-4) - streaming context and one-shot API.
The shared SHA-512 primitive for the whole library (SSH Ed25519 / kex hashing, PQC, SMB 3.1.1 preauth integrity). On Arduino (ESP32) the streaming context and one-shot delegate to mbedtls (hardware-accelerated where available); on native builds the software FIPS-180-4 implementation is used. Mirrors the sha256 dual-path structure.
Definition in file sha512.h.
| #define PC_SHA512_DIGEST_LEN 64 |
| #define PC_SHA512_BLOCK_LEN 128 |
| void pc_sha512_init | ( | pc_sha512_ctx * | ctx | ) |
Initialize a streaming SHA-512 context (ctx must not be NULL).
Definition at line 28 of file sha512.cpp.
References pc_sha512_ctx::mbed.
Referenced by pc_ed25519_sign(), pc_ed25519_verify(), pc_hmac_sha512_final(), and pc_hmac_sha512_init().
| void pc_sha512_update | ( | pc_sha512_ctx * | ctx, |
| const uint8_t * | data, | ||
| size_t | len | ||
| ) |
Feed len bytes of data into the running hash.
Definition at line 38 of file sha512.cpp.
References pc_sha512_ctx::mbed.
Referenced by pc_ed25519_sign(), pc_ed25519_verify(), pc_hmac_sha512_final(), pc_hmac_sha512_init(), and pc_hmac_sha512_update().
| void pc_sha512_final | ( | pc_sha512_ctx * | ctx, |
| uint8_t | digest[PC_SHA512_DIGEST_LEN] | ||
| ) |
Finalize the hash and write the 64-byte digest. The context is undefined afterwards; call init() again before reuse.
| digest | Output buffer, PC_SHA512_DIGEST_LEN bytes. |
Definition at line 47 of file sha512.cpp.
References pc_sha512_ctx::mbed.
Referenced by pc_ed25519_sign(), pc_ed25519_verify(), and pc_hmac_sha512_final().
| void pc_sha512 | ( | const uint8_t * | data, |
| size_t | len, | ||
| uint8_t | digest[PC_SHA512_DIGEST_LEN] | ||
| ) |
One-shot SHA-512: hash len bytes of data into digest (64 bytes).
Definition at line 57 of file sha512.cpp.
Referenced by PC_CRYPTO_HOT::build_key_block(), pc_ed25519_pubkey(), pc_ed25519_sign(), pc_rsa_verify(), and ssh_rsa_sign().