Leancrypto 0.12.0
Post-Quantum Cryptographic Library
|
Macros | |
#define | LC_HKDF_DRNG_CTX_ON_STACK(name, hashname) |
Allocate stack memory for the HKDF DRNG context. | |
#define | LC_CTR_KDF_DRNG_CTX_ON_STACK(name, hashname) |
Allocate stack memory for the Counter KDF DRNG context. | |
Functions | |
int | lc_hkdf_rng_alloc (struct lc_rng_ctx **state, const struct lc_hash *hash) |
Allocation of a HKDF DRNG context. | |
int | lc_kdf_ctr_rng_alloc (struct lc_rng_ctx **state, const struct lc_hash *hash) |
Allocation of a Counter KDF DRNG context. | |
The HKDF can be used as an RNG context for aggregated algorithms like Kyber or Dilithium. The idea is that the KDF state can be initialized from an input data to deterministically derive the values required for the algorithms the RNG context is used with.
#define LC_CTR_KDF_DRNG_CTX_ON_STACK | ( | name, | |
hashname ) |
Allocate stack memory for the Counter KDF DRNG context.
[in] | name | Name of the stack variable |
[in] | hashname | Reference to lc_hash implementation used for CTR KDF |
Definition at line 131 of file lc_kdf_ctr.h.
#define LC_HKDF_DRNG_CTX_ON_STACK | ( | name, | |
hashname ) |
Allocate stack memory for the HKDF DRNG context.
[in] | name | Name of the stack variable |
[in] | hashname | Reference to lc_hash implementation used for HKDF |
int lc_hkdf_rng_alloc | ( | struct lc_rng_ctx ** | state, |
const struct lc_hash * | hash ) |
Allocation of a HKDF DRNG context.
[out] | state | HKDF DRNG context allocated by the function |
[in] | hash | Reference to lc_hash implementation used for HKDF |
The cipher handle including its memory is allocated with this function.
The memory is pinned so that the DRNG state cannot be swapped out to disk.
int lc_kdf_ctr_rng_alloc | ( | struct lc_rng_ctx ** | state, |
const struct lc_hash * | hash ) |
Allocation of a Counter KDF DRNG context.
[out] | state | Counter KDF DRNG context allocated by the function |
[in] | hash | Reference to lc_hash implementation used for CTR KDF |
The cipher handle including its memory is allocated with this function.
The memory is pinned so that the DRNG state cannot be swapped out to disk.