|
Leancrypto 1.6.0
Post-Quantum Cryptographic Library
|
Macros | |
| #define | LC_KMAC_KDF_DRNG_CTX_ON_STACK(name, hashname) |
| Allocate stack memory for the KMAC DRNG context. | |
| #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_kmac_rng_alloc (struct lc_rng_ctx **state, const struct lc_hash *hash) |
| Allocation of a KMAC DRNG context. | |
| 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. | |
Variables | |
| const struct lc_rng * | lc_kmac_rng |
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 |
| #define LC_KMAC_KDF_DRNG_CTX_ON_STACK | ( | name, | |
| hashname ) |
Allocate stack memory for the KMAC DRNG context.
| [in] | name | Name of the stack variable |
| [in] | hashname | Reference to lc_hash implementation - use lc_cshake256 or lc_cshake128. |
| 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.
| int lc_kmac_rng_alloc | ( | struct lc_rng_ctx ** | state, |
| const struct lc_hash * | hash ) |
Allocation of a KMAC DRNG context.
| [out] | state | KMAC DRNG context allocated by the function |
| [in] | hash | Reference to hash implementation to be used to perform RNG operation with. Use lc_cshake256 or lc_cshake128. |
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.
|
extern |
The KMAC can be used as an RNG context for aggregated algorithms like Kyber or Dilithium. The idea is that KMAC acts as a key derivation function whose state can be initialized from an input data to deterministically derive the values required for the algorithms the RNG context is used with.
This RNG state is NOT intended to serve as a general-purpose deterministic random number generator. For using KMAC as a such general-purpose DRNG, see the API provided with lc_kmac256_drng.h.