File syn_sha512.c¶
FileList > crypto > syn_sha512.c
Go to the source code of this file
SHA-512 & SHA-384 cryptographic hash and HMAC implementation.
#include "syn_sha512.h"#include <string.h>
Public Functions¶
| Type | Name |
|---|---|
| void | syn_hmac_sha384 (const void * key, size_t key_len, const void * data, size_t data_len, uint8_t mac) Compute HMAC-SHA384 over data using secret key (RFC 4231). |
| void | syn_hmac_sha384_final (SYN_HMAC_SHA384 * ctx, uint8_t mac) Finalize HMAC-SHA384 computation and retrieve 48-byte MAC. |
| void | syn_hmac_sha384_init (SYN_HMAC_SHA384 * ctx, const void * key, size_t key_len) Initialize HMAC-SHA384 context with a key. |
| void | syn_hmac_sha384_update (SYN_HMAC_SHA384 * ctx, const void * data, size_t len) Feed data chunk into HMAC-SHA384 computation. |
| void | syn_hmac_sha512 (const void * key, size_t key_len, const void * data, size_t data_len, uint8_t mac) Compute HMAC-SHA512 over data using secret key (RFC 4231). |
| void | syn_hmac_sha512_final (SYN_HMAC_SHA512 * ctx, uint8_t mac) Finalize HMAC-SHA512 computation and retrieve 64-byte MAC. |
| void | syn_hmac_sha512_init (SYN_HMAC_SHA512 * ctx, const void * key, size_t key_len) Initialize HMAC-SHA512 context with a key. |
| void | syn_hmac_sha512_update (SYN_HMAC_SHA512 * ctx, const void * data, size_t len) Feed data chunk into HMAC-SHA512 computation. |
| void | syn_sha384 (const void * data, size_t len, uint8_t hash) One-shot SHA-384 calculation. |
| void | syn_sha384_final (SYN_SHA512 * ctx, uint8_t hash) Finalize SHA-384 hash and produce 48-byte digest. |
| void | syn_sha384_init (SYN_SHA512 * ctx) Initialize context for SHA-384 hashing. |
| void | syn_sha512 (const void * data, size_t len, uint8_t hash) One-shot SHA-512 calculation. |
| void | syn_sha512_final (SYN_SHA512 * ctx, uint8_t hash) Finalize SHA-512 hash and produce 64-byte digest. |
| void | syn_sha512_init (SYN_SHA512 * ctx) Initialize context for SHA-512 hashing. |
| void | syn_sha512_update (SYN_SHA512 * ctx, const void * data, size_t len) Feed data into the SHA-512 / SHA-384 hash. |
Public Functions Documentation¶
function syn_hmac_sha384¶
Compute HMAC-SHA384 over data using secret key (RFC 4231).
void syn_hmac_sha384 (
const void * key,
size_t key_len,
const void * data,
size_t data_len,
uint8_t mac
)
Parameters:
keySecret key buffer.key_lenSecret key length in bytes.dataData buffer to authenticate.data_lenData length in bytes.macOutput 48-byte MAC buffer.
function syn_hmac_sha384_final¶
Finalize HMAC-SHA384 computation and retrieve 48-byte MAC.
Parameters:
ctxHMAC-SHA384 context.macOutput 48-byte MAC buffer.
function syn_hmac_sha384_init¶
Initialize HMAC-SHA384 context with a key.
Parameters:
ctxHMAC-SHA384 context.keySecret key buffer.key_lenSecret key length in bytes.
function syn_hmac_sha384_update¶
Feed data chunk into HMAC-SHA384 computation.
Parameters:
ctxHMAC-SHA384 context.dataData buffer to authenticate.lenLength in bytes.
function syn_hmac_sha512¶
Compute HMAC-SHA512 over data using secret key (RFC 4231).
void syn_hmac_sha512 (
const void * key,
size_t key_len,
const void * data,
size_t data_len,
uint8_t mac
)
Parameters:
keySecret key buffer.key_lenSecret key length in bytes.dataData buffer to authenticate.data_lenData length in bytes.macOutput 64-byte MAC buffer.
function syn_hmac_sha512_final¶
Finalize HMAC-SHA512 computation and retrieve 64-byte MAC.
Parameters:
ctxHMAC-SHA512 context.macOutput 64-byte MAC buffer.
function syn_hmac_sha512_init¶
Initialize HMAC-SHA512 context with a key.
Parameters:
ctxHMAC-SHA512 context.keySecret key buffer.key_lenSecret key length in bytes.
function syn_hmac_sha512_update¶
Feed data chunk into HMAC-SHA512 computation.
Parameters:
ctxHMAC-SHA512 context.dataData buffer to authenticate.lenLength in bytes.
function syn_sha384¶
One-shot SHA-384 calculation.
Parameters:
dataData to hash.lenLength in bytes.hashOutput 48-byte digest buffer.
function syn_sha384_final¶
Finalize SHA-384 hash and produce 48-byte digest.
Parameters:
ctxSHA-512 context initialized with syn_sha384_init().hashOutput buffer (must be at least 48 bytes).
function syn_sha384_init¶
Initialize context for SHA-384 hashing.
Parameters:
ctxContext to initialize.
function syn_sha512¶
One-shot SHA-512 calculation.
Parameters:
dataData to hash.lenLength in bytes.hashOutput 64-byte digest buffer.
function syn_sha512_final¶
Finalize SHA-512 hash and produce 64-byte digest.
Parameters:
ctxSHA-512 context.hashOutput buffer (must be at least 64 bytes).
function syn_sha512_init¶
Initialize context for SHA-512 hashing.
Parameters:
ctxContext to initialize.
function syn_sha512_update¶
Feed data into the SHA-512 / SHA-384 hash.
Parameters:
ctxSHA-512 context.dataData buffer to hash.lenLength in bytes.
The documentation for this class was generated from the following file src/syntropic/crypto/syn_sha512.c