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

Go to the source code of this file.

Macros

#define LC_KMAC_FLAGS_SUPPORT_REINIT   (1 << 0)
#define LC_KMAC_CTX_ON_STACK(name, hashname)
 Allocate stack memory for the KMAC context.
#define LC_KMAC_CTX_ON_STACK_REINIT(name, hashname)
 Allocate stack memory for the KMAC context.
#define LC_KMAC_KDF_DRNG_CTX_ON_STACK(name, hashname)
 Allocate stack memory for the KMAC DRNG context.

Functions

int lc_kmac_init (struct lc_kmac_ctx *kmac_ctx, const uint8_t *key, size_t klen, const uint8_t *s, size_t slen)
 Initialize KMAC context.
void lc_kmac_reinit (struct lc_kmac_ctx *kmac_ctx)
 Re-initialize KMAC context after a kmac_final operation.
void lc_kmac_update (struct lc_kmac_ctx *kmac_ctx, const uint8_t *in, size_t inlen)
 Update KMAC.
void lc_kmac_final (struct lc_kmac_ctx *kmac_ctx, uint8_t *mac, size_t maclen)
 Calculate KMAC MAC.
void lc_kmac_final_xof (struct lc_kmac_ctx *kmac_ctx, uint8_t *mac, size_t maclen)
 Calculate KMAC MAC in XOF mode.
int lc_kmac_alloc (const struct lc_hash *hash, struct lc_kmac_ctx **kmac_ctx, uint32_t flags)
 Allocate KMAC context on heap.
void lc_kmac_zero_free (struct lc_kmac_ctx *kmac_ctx)
 Zeroize and free KMAC context.
void lc_kmac_zero (struct lc_kmac_ctx *kmac_ctx)
 Zeroize KMAC context allocated with either LC_KMAC_CTX_ON_STACK or lc_kmac_alloc.
size_t lc_kmac_macsize (struct lc_kmac_ctx *kmac_ctx)
 Return the MAC size.
int lc_kmac (const struct lc_hash *hash, const uint8_t *key, size_t keylen, const uint8_t *s, size_t slen, const uint8_t *in, size_t inlen, uint8_t *mac, size_t maclen)
 Calculate KMAC - one-shot.
int lc_kmac_xof (const struct lc_hash *hash, const uint8_t *key, size_t keylen, const uint8_t *s, size_t slen, const uint8_t *in, size_t inlen, uint8_t *mac, size_t maclen)
 Calculate KMAC in XOF mode - one-shot.
int lc_kmac_rng_alloc (struct lc_rng_ctx **state, const struct lc_hash *hash)
 Allocation of a KMAC DRNG context.

Variables

const struct lc_rng * lc_kmac_rng

Macro Definition Documentation

◆ LC_KMAC_FLAGS_SUPPORT_REINIT

#define LC_KMAC_FLAGS_SUPPORT_REINIT   (1 << 0)

Definition at line 182 of file lc_kmac.h.