|
wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
|
FIPS 198-1 HMAC-SHA-256 and HMAC-SHA-384. More...
#include "common/bytes/span/span.h"#include "crypto/symmetric/hash/hash/sha256.h"#include "crypto/symmetric/hash/hash/sha384.h"Go to the source code of this file.
Functions | |
| void | quic_hmac_sha256 (quic_span key, quic_span msg, u8 out[QUIC_SHA256_DIGEST]) |
| Compute HMAC-SHA-256(key, msg). | |
| void | quic_hmac_sha256_truncated (quic_span key, quic_span msg, u8 *out, usz out_len) |
| Compute HMAC-SHA-256(key, msg) truncated to its leftmost out_len bytes (FIPS 198-1 5, "Truncation of HMAC Output": MAC = leftmost Tlen bytes of HMAC(K, text)). | |
| void | quic_hmac_sha384 (quic_span key, quic_span msg, u8 out[QUIC_SHA384_DIGEST]) |
| Compute HMAC-SHA-384(key, msg) (RFC 2104, FIPS 180-4 SHA-384). | |
FIPS 198-1 HMAC-SHA-256 and HMAC-SHA-384.
Outputs are 32-byte and 48-byte MACs respectively.
Compute HMAC-SHA-256(key, msg).
| key | MAC key (any length; keys longer than one block are hashed) |
| msg | message to authenticate |
| out | receives the 32-byte MAC |
Compute HMAC-SHA-256(key, msg) truncated to its leftmost out_len bytes (FIPS 198-1 5, "Truncation of HMAC Output": MAC = leftmost Tlen bytes of HMAC(K, text)).
| key | MAC key (any length; keys longer than one block are hashed) |
| msg | message to authenticate |
| out | receives the truncated MAC |
| out_len | number of leftmost bytes to keep (0..QUIC_SHA256_DIGEST) |