DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
ssh_sha512.cpp File Reference

SHA-512 implementation (FIPS 180-4). More...

#include "network_drivers/presentation/ssh/crypto/ssh_sha512.h"
#include <string.h>
#include <mbedtls/sha512.h>

Go to the source code of this file.

Functions

void ssh_sha512_init (SshSha512Ctx *ctx)
 Initialize a streaming SHA-512 context (ctx must not be NULL).
 
void ssh_sha512_update (SshSha512Ctx *ctx, const uint8_t *data, size_t len)
 Feed len bytes of data into the running hash.
 
void ssh_sha512_final (SshSha512Ctx *ctx, uint8_t digest[SSH_SHA512_DIGEST_LEN])
 Finalize the hash and write the 64-byte digest. The context is undefined afterwards; call init() again before reuse.
 
void ssh_sha512 (const uint8_t *data, size_t len, uint8_t digest[SSH_SHA512_DIGEST_LEN])
 One-shot SHA-512: hash len bytes of data into digest (64 bytes).
 

Detailed Description

SHA-512 implementation (FIPS 180-4).

On Arduino builds streaming + one-shot delegate to mbedtls; on native builds the software path below is used. Backs Ed25519 (RFC 8032), which hashes with SHA-512.

Definition in file ssh_sha512.cpp.

Function Documentation

◆ ssh_sha512_init()

void ssh_sha512_init ( SshSha512Ctx ctx)

Initialize a streaming SHA-512 context (ctx must not be NULL).

Definition at line 23 of file ssh_sha512.cpp.

References SshSha512Ctx::mbed.

Referenced by ssh_ed25519_sign(), ssh_ed25519_verify(), ssh_hmac_sha512_final(), and ssh_hmac_sha512_init().

◆ ssh_sha512_update()

void ssh_sha512_update ( SshSha512Ctx ctx,
const uint8_t *  data,
size_t  len 
)

Feed len bytes of data into the running hash.

Definition at line 33 of file ssh_sha512.cpp.

References SshSha512Ctx::mbed.

Referenced by ssh_ed25519_sign(), ssh_ed25519_verify(), ssh_hmac_sha512_final(), ssh_hmac_sha512_init(), and ssh_hmac_sha512_update().

◆ ssh_sha512_final()

void ssh_sha512_final ( SshSha512Ctx ctx,
uint8_t  digest[SSH_SHA512_DIGEST_LEN] 
)

Finalize the hash and write the 64-byte digest. The context is undefined afterwards; call init() again before reuse.

Parameters
digestOutput buffer, SSH_SHA512_DIGEST_LEN bytes.

Definition at line 42 of file ssh_sha512.cpp.

References SshSha512Ctx::mbed.

Referenced by ssh_ed25519_sign(), ssh_ed25519_verify(), and ssh_hmac_sha512_final().

◆ ssh_sha512()

void ssh_sha512 ( const uint8_t *  data,
size_t  len,
uint8_t  digest[SSH_SHA512_DIGEST_LEN] 
)

One-shot SHA-512: hash len bytes of data into digest (64 bytes).

Definition at line 52 of file ssh_sha512.cpp.

Referenced by ssh_ed25519_pubkey(), ssh_ed25519_sign(), ssh_rsa_sign(), and ssh_rsa_verify().