Leancrypto 1.6.0
Post-Quantum Cryptographic Library
Loading...
Searching...
No Matches
lc_hkdf.h File Reference
#include "ext_headers.h"
#include "lc_hmac.h"
#include "lc_rng.h"
#include "lc_memset_secure.h"
Include dependency graph for lc_hkdf.h:

Go to the source code of this file.

Macros

#define LC_HKDF_CTX_ON_STACK(name, hashname)
 Allocate stack memory for the HKDF context.
#define LC_HKDF_DRNG_CTX_ON_STACK(name, hashname)
 Allocate stack memory for the HKDF DRNG context.

Functions

int lc_hkdf_extract (struct lc_hkdf_ctx *hkdf_ctx, const uint8_t *ikm, size_t ikmlen, const uint8_t *salt, size_t saltlen)
 HMAC-based Extract-and-Expand Key Derivation Function (HKDF) - RFC5869 Extract phase.
int lc_hkdf_expand (struct lc_hkdf_ctx *hkdf_ctx, const uint8_t *info, size_t infolen, uint8_t *dst, size_t dlen)
 HMAC-based Extract-and-Expand Key Derivation Function (HKDF) - RFC5869 Expand phase.
void lc_hkdf_zero (struct lc_hkdf_ctx *hkdf_ctx)
 Zeroize HKDF context allocated with either LC_HKDF_CTX_ON_STACK or hkdf_alloc.
int lc_hkdf_alloc (const struct lc_hash *hash, struct lc_hkdf_ctx **hkdf_ctx)
 Allocate HKDF context on heap.
void lc_hkdf_zero_free (struct lc_hkdf_ctx *hkdf_ctx)
 Zeroize and free HKDF context.
int lc_hkdf (const struct lc_hash *hash, const uint8_t *ikm, size_t ikmlen, const uint8_t *salt, size_t saltlen, const uint8_t *info, size_t infolen, uint8_t *dst, size_t dlen)
 HMAC-based Extract-and-Expand Key Derivation Function (HKDF) - RFC5869 Complete implementation.
int lc_hkdf_rng_alloc (struct lc_rng_ctx **state, const struct lc_hash *hash)
 Allocation of a HKDF DRNG context.

Variables

const struct lc_rng * lc_hkdf_rng

Variable Documentation

◆ lc_hkdf_rng

const struct lc_rng* lc_hkdf_rng
extern