Leancrypto 0.12.0
Post-Quantum Cryptographic Library
Loading...
Searching...
No Matches
lc_hmac.h File Reference
#include "lc_hash.h"
#include "lc_sha3.h"
#include "lc_memset_secure.h"
+ Include dependency graph for lc_hmac.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LC_HMAC_CTX_ON_STACK(name, hashname)
 Allocate stack memory for the HMAC context.
 

Functions

void lc_hmac_init (struct lc_hmac_ctx *hmac_ctx, const uint8_t *key, size_t keylen)
 Initialize HMAC context.
 
void lc_hmac_reinit (struct lc_hmac_ctx *hmac_ctx)
 Re-initialize HMAC context after a hmac_final operation.
 
void lc_hmac_update (struct lc_hmac_ctx *hmac_ctx, const uint8_t *in, size_t inlen)
 Update HMAC.
 
void lc_hmac_final (struct lc_hmac_ctx *hmac_ctx, uint8_t *mac)
 Calculate HMAC mac.
 
int lc_hmac_alloc (const struct lc_hash *hash, struct lc_hmac_ctx **hmac_ctx)
 Allocate HMAC context on heap.
 
void lc_hmac_zero_free (struct lc_hmac_ctx *hmac_ctx)
 Zeroize and free HMAC context.
 
static void lc_hmac_zero (struct lc_hmac_ctx *hmac_ctx)
 Zeroize HMAC context allocated with either HMAC_CTX_ON_STACK or hmac_alloc.
 
static size_t lc_hmac_macsize (struct lc_hmac_ctx *hmac_ctx)
 Return the MAC size.
 
static void lc_hmac (const struct lc_hash *hash, const uint8_t *key, size_t keylen, const uint8_t *in, size_t inlen, uint8_t *mac)
 Calculate HMAC - one-shot.