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

HMAC-SHA2-512 implementation (RFC 2104). See ssh_hmac_sha512.h. More...

Go to the source code of this file.

Functions

void ssh_hmac_sha512_init (SshHmacSha512Ctx *ctx, const uint8_t *key, size_t key_len)
 Begin an HMAC-SHA2-512 over key (keys > 128 bytes are pre-hashed per RFC 2104).
 
void ssh_hmac_sha512_update (SshHmacSha512Ctx *ctx, const uint8_t *data, size_t len)
 Feed len message bytes.
 
void ssh_hmac_sha512_final (SshHmacSha512Ctx *ctx, uint8_t mac[SSH_HMAC_SHA512_LEN])
 Finish, writing the 64-byte MAC.
 
void ssh_hmac_sha512 (const uint8_t *key, size_t key_len, const uint8_t *data, size_t len, uint8_t mac[SSH_HMAC_SHA512_LEN])
 One-shot HMAC-SHA2-512 over a single buffer.
 

Detailed Description

HMAC-SHA2-512 implementation (RFC 2104). See ssh_hmac_sha512.h.

HMAC(K, m) = H((K XOR opad) || H((K XOR ipad) || m)), H = SHA-512, block = 128 bytes, ipad = 0x36 repeated, opad = 0x5c repeated.

Definition in file ssh_hmac_sha512.cpp.

Function Documentation

◆ ssh_hmac_sha512_init()

void ssh_hmac_sha512_init ( SshHmacSha512Ctx ctx,
const uint8_t *  key,
size_t  key_len 
)

Begin an HMAC-SHA2-512 over key (keys > 128 bytes are pre-hashed per RFC 2104).

Definition at line 34 of file ssh_hmac_sha512.cpp.

References SshHmacSha512Ctx::inner, SshHmacSha512Ctx::okey, SSH_SHA512_BLOCK_LEN, ssh_sha512_init(), and ssh_sha512_update().

Referenced by ssh_hmac_sha512().

◆ ssh_hmac_sha512_update()

void ssh_hmac_sha512_update ( SshHmacSha512Ctx ctx,
const uint8_t *  data,
size_t  len 
)

Feed len message bytes.

Definition at line 43 of file ssh_hmac_sha512.cpp.

References SshHmacSha512Ctx::inner, and ssh_sha512_update().

Referenced by ssh_hmac_sha512().

◆ ssh_hmac_sha512_final()

void ssh_hmac_sha512_final ( SshHmacSha512Ctx ctx,
uint8_t  mac[SSH_HMAC_SHA512_LEN] 
)

◆ ssh_hmac_sha512()

void ssh_hmac_sha512 ( const uint8_t *  key,
size_t  key_len,
const uint8_t *  data,
size_t  len,
uint8_t  mac[SSH_HMAC_SHA512_LEN] 
)

One-shot HMAC-SHA2-512 over a single buffer.

Definition at line 59 of file ssh_hmac_sha512.cpp.

References ssh_hmac_sha512_final(), ssh_hmac_sha512_init(), and ssh_hmac_sha512_update().