Leancrypto 0.12.0
Post-Quantum Cryptographic Library
Loading...
Searching...
No Matches
lc_xdrbg.h File Reference
#include "lc_ascon_hash.h"
#include "lc_sha3.h"
#include "lc_rng.h"
+ Include dependency graph for lc_xdrbg.h:

Go to the source code of this file.

Macros

#define LC_XDRBG256_DRNG_CTX_ON_STACK(name)
 Allocate stack memory for the XDRBG256 DRNG context.
 
#define LC_XDRBG128_DRNG_CTX_ON_STACK(name)
 Allocate stack memory for the XDRBG128 DRNG context.
 

Functions

int lc_xdrbg256_drng_alloc (struct lc_rng_ctx **state)
 Allocation of a XDRBG256 DRNG context using SHAKE-256.
 
int lc_xdrbg128_drng_alloc (struct lc_rng_ctx **state)
 Allocation of a XDRBG128 DRNG context using Ascon-XOF.
 

Macro Definition Documentation

◆ LC_XDRBG128_DRNG_CTX_ON_STACK

#define LC_XDRBG128_DRNG_CTX_ON_STACK ( name)
Value:
LC_XDRBG_DRNG_CTX_ON_STACK(name); \
LC_XDRBG128_RNG_CTX(name)

Allocate stack memory for the XDRBG128 DRNG context.

XDRBG 128 definition using Ascon-XOF to provide a lightweight algorithm providing the following security level:

    * classical: 128 bits of security

    * quantum (Grover): 64 bits of security

    * category: NIST level 1
Parameters
[in]nameName of the stack variable
Warning
You MUST seed the DRNG!

Definition at line 154 of file lc_xdrbg.h.

◆ LC_XDRBG256_DRNG_CTX_ON_STACK

#define LC_XDRBG256_DRNG_CTX_ON_STACK ( name)
Value:
LC_XDRBG_DRNG_CTX_ON_STACK(name); \
LC_XDRBG256_RNG_CTX(name)

Allocate stack memory for the XDRBG256 DRNG context.

XDRBG 256 definition using SHAKE-256 providing the following security level:

    * classical: 256 bits of security

    * quantum (Grover): 128 bits of security

    * category: NIST level 5
Parameters
[in]nameName of the stack variable
Warning
You MUST seed the DRNG!

Definition at line 96 of file lc_xdrbg.h.

Function Documentation

◆ lc_xdrbg128_drng_alloc()

int lc_xdrbg128_drng_alloc ( struct lc_rng_ctx ** state)

Allocation of a XDRBG128 DRNG context using Ascon-XOF.

Parameters
[out]stateXDRBG128 DRNG context allocated by the function

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.

Warning
You MUST seed the DRNG!
Returns
0 upon success; < 0 on error

◆ lc_xdrbg256_drng_alloc()

int lc_xdrbg256_drng_alloc ( struct lc_rng_ctx ** state)

Allocation of a XDRBG256 DRNG context using SHAKE-256.

Parameters
[out]stateXDRBG256 DRNG context allocated by the function

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.

Warning
You MUST seed the DRNG!
Returns
0 upon success; < 0 on error