Leancrypto 1.7.2
Post-Quantum Cryptographic Library
Macros | Functions | Variables
lc_kmac.h File Reference
#include "lc_hash.h"
#include "lc_rng.h"
#include "lc_sha3.h"
#include "lc_status.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. More...
 
#define LC_KMAC_CTX_ON_STACK_REINIT(name, hashname)
 Allocate stack memory for the KMAC context. More...
 
#define LC_KMAC_KDF_DRNG_CTX_ON_STACK(name, hashname)
 Allocate stack memory for the KMAC DRNG context. More...
 

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. More...
 
void lc_kmac_reinit (struct lc_kmac_ctx *kmac_ctx)
 Re-initialize KMAC context after a kmac_final operation. More...
 
void lc_kmac_update (struct lc_kmac_ctx *kmac_ctx, const uint8_t *in, size_t inlen)
 Update KMAC. More...
 
int lc_kmac_final (struct lc_kmac_ctx *kmac_ctx, uint8_t *mac, size_t maclen)
 Calculate KMAC MAC. More...
 
void lc_kmac_final_xof (struct lc_kmac_ctx *kmac_ctx, uint8_t *mac, size_t maclen)
 Calculate KMAC MAC in XOF mode. More...
 
int lc_kmac_alloc (const struct lc_hash *hash, struct lc_kmac_ctx **kmac_ctx, uint32_t flags)
 Allocate KMAC context on heap. More...
 
void lc_kmac_zero_free (struct lc_kmac_ctx *kmac_ctx)
 Zeroize and free KMAC context. More...
 
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. More...
 
enum lc_alg_status_val lc_kmac_alg_status (const struct lc_hash *hash)
 Obtain algorithm status. More...
 
enum lc_alg_status_val lc_kmac_ctx_alg_status (const struct lc_hash_ctx *ctx)
 Obtain algorithm status. More...
 
size_t lc_kmac_macsize (struct lc_kmac_ctx *kmac_ctx)
 Return the MAC size. More...
 
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. More...
 
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. More...
 
int lc_kmac_rng_alloc (struct lc_rng_ctx **state, const struct lc_hash *hash)
 Allocation of a KMAC DRNG context. More...
 

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 185 of file lc_kmac.h.