Leancrypto 1.7.2
Post-Quantum Cryptographic Library
Data Structures | Enumerations | Functions
lc_dilithium.h File Reference
#include "ext_headers.h"
#include "lc_status.h"
+ Include dependency graph for lc_dilithium.h:

Go to the source code of this file.

Data Structures

struct  lc_dilithium_sk
 Dilithium secret key. More...
 
struct  lc_dilithium_pk
 Dilithium public key. More...
 
struct  lc_dilithium_sig
 Dilithium signature. More...
 
struct  lc_dilithium_ed25519_sk
 Dilithium secret key. More...
 
struct  lc_dilithium_ed25519_pk
 Dilithium public key. More...
 
struct  lc_dilithium_ed25519_sig
 Dilithium signature. More...
 
struct  lc_dilithium_ed448_sk
 Dilithium secret key. More...
 
struct  lc_dilithium_ed448_pk
 Dilithium public key. More...
 
struct  lc_dilithium_ed448_sig
 Dilithium signature. More...
 
union  lc_dilithium_sk.key
 
union  lc_dilithium_pk.key
 
union  lc_dilithium_sig.sig
 
union  lc_dilithium_ed25519_sk.key
 
union  lc_dilithium_ed25519_pk.key
 
union  lc_dilithium_ed25519_sig.sig
 
union  lc_dilithium_ed448_sk.key
 
union  lc_dilithium_ed448_pk.key
 
union  lc_dilithium_ed448_sig.sig
 

Enumerations

enum  lc_dilithium_type { LC_DILITHIUM_UNKNOWN , LC_DILITHIUM_87 , LC_DILITHIUM_65 , LC_DILITHIUM_44 }
 
enum  lc_dilithium_alg_operation { lc_alg_operation_dilithium_unknown , lc_alg_operation_dilithium_keygen , lc_alg_operation_dilithium_siggen , lc_alg_operation_dilithium_sigver }
 

Functions

int lc_dilithium_ctx_alloc (struct lc_dilithium_ctx **ctx)
 Allocate stack memory for the Dilithium stream context and additional parameter relevant for the signature operation. More...
 
int lc_dilithium_ctx_alloc_ahat (struct lc_dilithium_ctx **ctx)
 Allocates Dilithium context on heap with support to keep the internal representation of the key. More...
 
void lc_dilithium_ctx_zero_free (struct lc_dilithium_ctx *ctx)
 Zeroizes and frees Dilithium context on heap. More...
 
void lc_dilithium_ctx_zero (struct lc_dilithium_ctx *ctx)
 Zeroizes Dilithium context either on heap or on stack. More...
 
void lc_dilithium_ctx_internal (struct lc_dilithium_ctx *ctx)
 Mark the Dilithium context to execute ML-DSA.Sign_internal / ML-DSA.Verify_internal. More...
 
void lc_dilithium_ctx_hash (struct lc_dilithium_ctx *ctx, const struct lc_hash *hash)
 Set the hash type that was used for pre-hashing the message. The message digest is used with the HashML-DSA. The message digest is to be provided via the message pointer in the sign/verify APIs. More...
 
void lc_dilithium_ctx_userctx (struct lc_dilithium_ctx *ctx, const uint8_t *userctx, size_t userctxlen)
 Specify the optional user context string to be applied with the Dilithium signature operation. More...
 
void lc_dilithium_ctx_external_mu (struct lc_dilithium_ctx *ctx, const uint8_t *external_mu, size_t external_mu_len)
 Specify the optional external mu value. More...
 
void lc_dilithium_ctx_drop_ahat (struct lc_dilithium_ctx *ctx)
 Invalidate the expanded key that potentially is stored in the context. More...
 
enum lc_dilithium_type lc_dilithium_sk_type (const struct lc_dilithium_sk *sk)
 Obtain Dilithium type from secret key. More...
 
enum lc_dilithium_type lc_dilithium_pk_type (const struct lc_dilithium_pk *pk)
 Obtain Dilithium type from public key. More...
 
enum lc_dilithium_type lc_dilithium_sig_type (const struct lc_dilithium_sig *sig)
 Obtain Dilithium type from signature. More...
 
LC_PURE unsigned int lc_dilithium_sk_size (enum lc_dilithium_type dilithium_type)
 Return the size of the Dilithium secret key. More...
 
LC_PURE unsigned int lc_dilithium_pk_size (enum lc_dilithium_type dilithium_type)
 Return the size of the Dilithium public key. More...
 
LC_PURE unsigned int lc_dilithium_sig_size (enum lc_dilithium_type dilithium_type)
 Return the size of the Dilithium signature. More...
 
int lc_dilithium_sk_load (struct lc_dilithium_sk *sk, const uint8_t *src_key, size_t src_key_len)
 Load a Dilithium secret key provided with a buffer into the leancrypto data structure. More...
 
int lc_dilithium_pk_load (struct lc_dilithium_pk *pk, const uint8_t *src_key, size_t src_key_len)
 Load a Dilithium public key provided with a buffer into the leancrypto data structure. More...
 
int lc_dilithium_sig_load (struct lc_dilithium_sig *sig, const uint8_t *src_sig, size_t src_sig_len)
 Load a Dilithium signature provided with a buffer into the leancrypto data structure. More...
 
int lc_dilithium_sk_ptr (uint8_t **dilithium_key, size_t *dilithium_key_len, struct lc_dilithium_sk *sk)
 Obtain the reference to the Dilithium key and its length. More...
 
int lc_dilithium_pk_ptr (uint8_t **dilithium_key, size_t *dilithium_key_len, struct lc_dilithium_pk *pk)
 Obtain the reference to the Dilithium key and its length. More...
 
int lc_dilithium_sig_ptr (uint8_t **dilithium_sig, size_t *dilithium_sig_len, struct lc_dilithium_sig *sig)
 Obtain the reference to the Dilithium signature and its length. More...
 
int lc_dilithium_keypair (struct lc_dilithium_pk *pk, struct lc_dilithium_sk *sk, struct lc_rng_ctx *rng_ctx, enum lc_dilithium_type dilithium_type)
 Generates Dilithium public and private key. More...
 
int lc_dilithium_pk_from_sk (struct lc_dilithium_pk *pk, const struct lc_dilithium_sk *sk)
 Generates Dilithium public from private key. More...
 
int lc_dilithium_keypair_from_seed (struct lc_dilithium_pk *pk, struct lc_dilithium_sk *sk, const uint8_t *seed, size_t seedlen, enum lc_dilithium_type dilithium_type)
 Generates Dilithium public and private key from a given seed. More...
 
int lc_dilithium_pct (const struct lc_dilithium_pk *pk, const struct lc_dilithium_sk *sk)
 Pairwise consistency check as per FIPS 140 IG. More...
 
int lc_dilithium_sign (struct lc_dilithium_sig *sig, const uint8_t *m, size_t mlen, const struct lc_dilithium_sk *sk, struct lc_rng_ctx *rng_ctx)
 Computes signature in one shot. More...
 
int lc_dilithium_sign_ctx (struct lc_dilithium_sig *sig, struct lc_dilithium_ctx *ctx, const uint8_t *m, size_t mlen, const struct lc_dilithium_sk *sk, struct lc_rng_ctx *rng_ctx)
 Computes signature woth user context in one shot. More...
 
int lc_dilithium_sign_init (struct lc_dilithium_ctx *ctx, const struct lc_dilithium_sk *sk)
 Initializes a signature operation. More...
 
int lc_dilithium_sign_update (struct lc_dilithium_ctx *ctx, const uint8_t *m, size_t mlen)
 Add more data to an already initialized signature state. More...
 
int lc_dilithium_sign_final (struct lc_dilithium_sig *sig, struct lc_dilithium_ctx *ctx, const struct lc_dilithium_sk *sk, struct lc_rng_ctx *rng_ctx)
 Computes signature. More...
 
int lc_dilithium_verify (const struct lc_dilithium_sig *sig, const uint8_t *m, size_t mlen, const struct lc_dilithium_pk *pk)
 Verifies signature in one shot. More...
 
int lc_dilithium_verify_ctx (const struct lc_dilithium_sig *sig, struct lc_dilithium_ctx *ctx, const uint8_t *m, size_t mlen, const struct lc_dilithium_pk *pk)
 Verifies signature with Dilithium context in one shot. More...
 
int lc_dilithium_verify_init (struct lc_dilithium_ctx *ctx, const struct lc_dilithium_pk *pk)
 Initializes a signature verification operation. More...
 
int lc_dilithium_verify_update (struct lc_dilithium_ctx *ctx, const uint8_t *m, size_t mlen)
 Add more data to an already initialized signature state. More...
 
int lc_dilithium_verify_final (const struct lc_dilithium_sig *sig, struct lc_dilithium_ctx *ctx, const struct lc_dilithium_pk *pk)
 Verifies signature. More...
 
enum lc_alg_status_val lc_dilithium_alg_status (const enum lc_dilithium_type dilithium_type, const enum lc_dilithium_alg_operation operation)
 Obtain algorithm status. More...
 
int lc_dilithium_ed25519_ctx_alloc (struct lc_dilithium_ed25519_ctx **ctx)
 Allocates Dilithium-ED25519 context on heap. More...
 
void lc_dilithium_ed25519_ctx_zero_free (struct lc_dilithium_ed25519_ctx *ctx)
 Zeroizes and frees Dilithium-ED25519 context on heap. More...
 
void lc_dilithium_ed25519_ctx_zero (struct lc_dilithium_ed25519_ctx *ctx)
 Zeroizes Dilithium-ED25519 context either on heap or on stack. More...
 
void lc_dilithium_ed25519_ctx_hash (struct lc_dilithium_ed25519_ctx *ctx, const struct lc_hash *hash)
 Set the hash type that was used for pre-hashing the message. The message digest ist used with the HashML-DSA. The message digest is to be provided via the message pointer in the sign/verify APIs. More...
 
void lc_dilithium_ed25519_ctx_internal (struct lc_dilithium_ed25519_ctx *ctx)
 Mark the Dilithium context to execute ML-DSA.Sign_internal / ML-DSA.Verify_internal. More...
 
void lc_dilithium_ed25519_ctx_userctx (struct lc_dilithium_ed25519_ctx *ctx, const uint8_t *userctx, size_t userctxlen)
 Specify the optional user context string to be applied with the Dilithium-ED25519 signature operation. More...
 
enum lc_dilithium_type lc_dilithium_ed25519_sk_type (const struct lc_dilithium_ed25519_sk *sk)
 Obtain Dilithium type from secret key. More...
 
enum lc_dilithium_type lc_dilithium_ed25519_pk_type (const struct lc_dilithium_ed25519_pk *pk)
 Obtain Dilithium type from public key. More...
 
enum lc_dilithium_type lc_dilithium_ed25519_sig_type (const struct lc_dilithium_ed25519_sig *sig)
 Obtain Dilithium type from signature. More...
 
LC_PURE unsigned int lc_dilithium_ed25519_sk_size (enum lc_dilithium_type dilithium_type)
 Return the size of the Dilithium secret key. More...
 
LC_PURE unsigned int lc_dilithium_ed25519_pk_size (enum lc_dilithium_type dilithium_type)
 Return the size of the Dilithium public key. More...
 
LC_PURE unsigned int lc_dilithium_ed25519_sig_size (enum lc_dilithium_type dilithium_type)
 Return the size of the Dilithium signature. More...
 
int lc_dilithium_ed25519_sk_load (struct lc_dilithium_ed25519_sk *sk, const uint8_t *dilithium_src_key, size_t dilithium_src_key_len, const uint8_t *ed25519_src_key, size_t ed25519_src_key_len)
 Load a Dilithium secret key provided with a buffer into the leancrypto data structure. More...
 
int lc_dilithium_ed25519_pk_load (struct lc_dilithium_ed25519_pk *pk, const uint8_t *dilithium_src_key, size_t dilithium_src_key_len, const uint8_t *ed25519_src_key, size_t ed25519_src_key_len)
 Load a Dilithium public key provided with a buffer into the leancrypto data structure. More...
 
int lc_dilithium_ed25519_sig_load (struct lc_dilithium_ed25519_sig *sig, const uint8_t *dilithium_src_sig, size_t dilithium_src_sig_len, const uint8_t *ed25519_src_sig, size_t ed25519_src_sig_len)
 Load a Dilithium signature provided with a buffer into the leancrypto data structure. More...
 
int lc_dilithium_ed25519_sk_ptr (uint8_t **dilithium_key, size_t *dilithium_key_len, uint8_t **ed25519_key, size_t *ed25519_key_len, struct lc_dilithium_ed25519_sk *sk)
 Obtain the reference to the Dilithium key and its length. More...
 
int lc_dilithium_ed25519_pk_ptr (uint8_t **dilithium_key, size_t *dilithium_key_len, uint8_t **ed25519_key, size_t *ed25519_key_len, struct lc_dilithium_ed25519_pk *pk)
 Obtain the reference to the Dilithium key and its length. More...
 
int lc_dilithium_ed25519_sig_ptr (uint8_t **dilithium_sig, size_t *dilithium_sig_len, uint8_t **ed25519_sig, size_t *ed25519_sig_len, struct lc_dilithium_ed25519_sig *sig)
 Obtain the reference to the Dilithium signature and its length. More...
 
int lc_dilithium_ed25519_keypair (struct lc_dilithium_ed25519_pk *pk, struct lc_dilithium_ed25519_sk *sk, struct lc_rng_ctx *rng_ctx, enum lc_dilithium_type dilithium_type)
 Generates Dilithium public and private key. More...
 
int lc_dilithium_ed25519_pk_from_sk (struct lc_dilithium_ed25519_pk *pk, const struct lc_dilithium_ed25519_sk *sk)
 Generates Dilithium public from private key. More...
 
int lc_dilithium_ed25519_sign (struct lc_dilithium_ed25519_sig *sig, const uint8_t *m, size_t mlen, const struct lc_dilithium_ed25519_sk *sk, struct lc_rng_ctx *rng_ctx)
 Computes signature in one shot. More...
 
int lc_dilithium_ed25519_sign_ctx (struct lc_dilithium_ed25519_sig *sig, struct lc_dilithium_ed25519_ctx *ctx, const uint8_t *m, size_t mlen, const struct lc_dilithium_ed25519_sk *sk, struct lc_rng_ctx *rng_ctx)
 Computes signature with Dilithium context in one shot. More...
 
int lc_dilithium_ed25519_sign_init (struct lc_dilithium_ed25519_ctx *ctx, const struct lc_dilithium_ed25519_sk *sk)
 Initializes signature operation in stream mode. More...
 
int lc_dilithium_ed25519_sign_update (struct lc_dilithium_ed25519_ctx *ctx, const uint8_t *m, size_t mlen)
 Updates signature in stream mode. More...
 
int lc_dilithium_ed25519_sign_final (struct lc_dilithium_ed25519_sig *sig, struct lc_dilithium_ed25519_ctx *ctx, const struct lc_dilithium_ed25519_sk *sk, struct lc_rng_ctx *rng_ctx)
 Computes signature in stream mode. More...
 
int lc_dilithium_ed25519_verify (const struct lc_dilithium_ed25519_sig *sig, const uint8_t *m, size_t mlen, const struct lc_dilithium_ed25519_pk *pk)
 Verifies signature in one shot. More...
 
int lc_dilithium_ed25519_verify_ctx (const struct lc_dilithium_ed25519_sig *sig, struct lc_dilithium_ed25519_ctx *ctx, const uint8_t *m, size_t mlen, const struct lc_dilithium_ed25519_pk *pk)
 Verifies signature with Dilithium context in one shot. More...
 
int lc_dilithium_ed25519_verify_init (struct lc_dilithium_ed25519_ctx *ctx, const struct lc_dilithium_ed25519_pk *pk)
 Initializes signature verification operation in stream mode. More...
 
int lc_dilithium_ed25519_verify_update (struct lc_dilithium_ed25519_ctx *ctx, const uint8_t *m, size_t mlen)
 Updates signature verification in stream mode. More...
 
int lc_dilithium_ed25519_verify_final (const struct lc_dilithium_ed25519_sig *sig, struct lc_dilithium_ed25519_ctx *ctx, const struct lc_dilithium_ed25519_pk *pk)
 Verifies signature in stream mode. More...
 
int lc_dilithium_ed448_ctx_alloc (struct lc_dilithium_ed448_ctx **ctx)
 Allocates Dilithium-ED448 context on heap. More...
 
void lc_dilithium_ed448_ctx_zero_free (struct lc_dilithium_ed448_ctx *ctx)
 Zeroizes and frees Dilithium-ED448 context on heap. More...
 
void lc_dilithium_ed448_ctx_zero (struct lc_dilithium_ed448_ctx *ctx)
 Zeroizes Dilithium-ED448 context either on heap or on stack. More...
 
void lc_dilithium_ed448_ctx_hash (struct lc_dilithium_ed448_ctx *ctx, const struct lc_hash *hash)
 Set the hash type that was used for pre-hashing the message. The message digest ist used with the HashML-DSA. The message digest is to be provided via the message pointer in the sign/verify APIs. More...
 
void lc_dilithium_ed448_ctx_internal (struct lc_dilithium_ed448_ctx *ctx)
 Mark the Dilithium context to execute ML-DSA.Sign_internal / ML-DSA.Verify_internal. More...
 
void lc_dilithium_ed448_ctx_userctx (struct lc_dilithium_ed448_ctx *ctx, const uint8_t *userctx, size_t userctxlen)
 Specify the optional user context string to be applied with the Dilithium-ED448 signature operation. More...
 
enum lc_dilithium_type lc_dilithium_ed448_sk_type (const struct lc_dilithium_ed448_sk *sk)
 Obtain Dilithium type from secret key. More...
 
enum lc_dilithium_type lc_dilithium_ed448_pk_type (const struct lc_dilithium_ed448_pk *pk)
 Obtain Dilithium type from public key. More...
 
enum lc_dilithium_type lc_dilithium_ed448_sig_type (const struct lc_dilithium_ed448_sig *sig)
 Obtain Dilithium type from signature. More...
 
LC_PURE unsigned int lc_dilithium_ed448_sk_size (enum lc_dilithium_type dilithium_type)
 Return the size of the Dilithium secret key. More...
 
LC_PURE unsigned int lc_dilithium_ed448_pk_size (enum lc_dilithium_type dilithium_type)
 Return the size of the Dilithium public key. More...
 
LC_PURE unsigned int lc_dilithium_ed448_sig_size (enum lc_dilithium_type dilithium_type)
 Return the size of the Dilithium signature. More...
 
int lc_dilithium_ed448_sk_load (struct lc_dilithium_ed448_sk *sk, const uint8_t *dilithium_src_key, size_t dilithium_src_key_len, const uint8_t *ed448_src_key, size_t ed448_src_key_len)
 Load a Dilithium secret key provided with a buffer into the leancrypto data structure. More...
 
int lc_dilithium_ed448_pk_load (struct lc_dilithium_ed448_pk *pk, const uint8_t *dilithium_src_key, size_t dilithium_src_key_len, const uint8_t *ed448_src_key, size_t ed448_src_key_len)
 Load a Dilithium public key provided with a buffer into the leancrypto data structure. More...
 
int lc_dilithium_ed448_sig_load (struct lc_dilithium_ed448_sig *sig, const uint8_t *dilithium_src_sig, size_t dilithium_src_sig_len, const uint8_t *ed448_src_sig, size_t ed448_src_sig_len)
 Load a Dilithium signature provided with a buffer into the leancrypto data structure. More...
 
int lc_dilithium_ed448_sk_ptr (uint8_t **dilithium_key, size_t *dilithium_key_len, uint8_t **ed448_key, size_t *ed448_key_len, struct lc_dilithium_ed448_sk *sk)
 Obtain the reference to the Dilithium key and its length. More...
 
int lc_dilithium_ed448_pk_ptr (uint8_t **dilithium_key, size_t *dilithium_key_len, uint8_t **ed448_key, size_t *ed448_key_len, struct lc_dilithium_ed448_pk *pk)
 Obtain the reference to the Dilithium key and its length. More...
 
int lc_dilithium_ed448_sig_ptr (uint8_t **dilithium_sig, size_t *dilithium_sig_len, uint8_t **ed448_sig, size_t *ed448_sig_len, struct lc_dilithium_ed448_sig *sig)
 Obtain the reference to the Dilithium signature and its length. More...
 
int lc_dilithium_ed448_keypair (struct lc_dilithium_ed448_pk *pk, struct lc_dilithium_ed448_sk *sk, struct lc_rng_ctx *rng_ctx, enum lc_dilithium_type dilithium_type)
 Generates Dilithium public and private key. More...
 
int lc_dilithium_ed448_pk_from_sk (struct lc_dilithium_ed448_pk *pk, const struct lc_dilithium_ed448_sk *sk)
 Generates Dilithium public from private key. More...
 
int lc_dilithium_ed448_sign (struct lc_dilithium_ed448_sig *sig, const uint8_t *m, size_t mlen, const struct lc_dilithium_ed448_sk *sk, struct lc_rng_ctx *rng_ctx)
 Computes signature in one shot. More...
 
int lc_dilithium_ed448_sign_ctx (struct lc_dilithium_ed448_sig *sig, struct lc_dilithium_ed448_ctx *ctx, const uint8_t *m, size_t mlen, const struct lc_dilithium_ed448_sk *sk, struct lc_rng_ctx *rng_ctx)
 Computes signature with Dilithium context in one shot. More...
 
int lc_dilithium_ed448_sign_init (struct lc_dilithium_ed448_ctx *ctx, const struct lc_dilithium_ed448_sk *sk)
 Initializes signature operation in stream mode. More...
 
int lc_dilithium_ed448_sign_update (struct lc_dilithium_ed448_ctx *ctx, const uint8_t *m, size_t mlen)
 Updates signature in stream mode. More...
 
int lc_dilithium_ed448_sign_final (struct lc_dilithium_ed448_sig *sig, struct lc_dilithium_ed448_ctx *ctx, const struct lc_dilithium_ed448_sk *sk, struct lc_rng_ctx *rng_ctx)
 Computes signature in stream mode. More...
 
int lc_dilithium_ed448_verify (const struct lc_dilithium_ed448_sig *sig, const uint8_t *m, size_t mlen, const struct lc_dilithium_ed448_pk *pk)
 Verifies signature in one shot. More...
 
int lc_dilithium_ed448_verify_ctx (const struct lc_dilithium_ed448_sig *sig, struct lc_dilithium_ed448_ctx *ctx, const uint8_t *m, size_t mlen, const struct lc_dilithium_ed448_pk *pk)
 Verifies signature with Dilithium context in one shot. More...
 
int lc_dilithium_ed448_verify_init (struct lc_dilithium_ed448_ctx *ctx, const struct lc_dilithium_ed448_pk *pk)
 Initializes signature verification operation in stream mode. More...
 
int lc_dilithium_ed448_verify_update (struct lc_dilithium_ed448_ctx *ctx, const uint8_t *m, size_t mlen)
 Updates signature verification in stream mode. More...
 
int lc_dilithium_ed448_verify_final (const struct lc_dilithium_ed448_sig *sig, struct lc_dilithium_ed448_ctx *ctx, const struct lc_dilithium_ed448_pk *pk)
 Verifies signature in stream mode. More...
 

Data Structure Documentation

◆ lc_dilithium_sk

struct lc_dilithium_sk

Dilithium secret key.

Definition at line 107 of file lc_dilithium.h.

Data Fields
enum lc_dilithium_type dilithium_type
union lc_dilithium_sk.key key

◆ lc_dilithium_pk

struct lc_dilithium_pk

Dilithium public key.

Definition at line 125 of file lc_dilithium.h.

Data Fields
enum lc_dilithium_type dilithium_type
union lc_dilithium_pk.key key

◆ lc_dilithium_sig

struct lc_dilithium_sig

Dilithium signature.

Definition at line 143 of file lc_dilithium.h.

Data Fields
enum lc_dilithium_type dilithium_type
union lc_dilithium_sig.sig sig

◆ lc_dilithium_ed25519_sk

struct lc_dilithium_ed25519_sk

Dilithium secret key.

Definition at line 783 of file lc_dilithium.h.

Data Fields
enum lc_dilithium_type dilithium_type
union lc_dilithium_ed25519_sk.key key

◆ lc_dilithium_ed25519_pk

struct lc_dilithium_ed25519_pk

Dilithium public key.

Definition at line 801 of file lc_dilithium.h.

Data Fields
enum lc_dilithium_type dilithium_type
union lc_dilithium_ed25519_pk.key key

◆ lc_dilithium_ed25519_sig

struct lc_dilithium_ed25519_sig

Dilithium signature.

Definition at line 819 of file lc_dilithium.h.

Data Fields
enum lc_dilithium_type dilithium_type
union lc_dilithium_ed25519_sig.sig sig

◆ lc_dilithium_ed448_sk

struct lc_dilithium_ed448_sk

Dilithium secret key.

Definition at line 1350 of file lc_dilithium.h.

Data Fields
enum lc_dilithium_type dilithium_type
union lc_dilithium_ed448_sk.key key

◆ lc_dilithium_ed448_pk

struct lc_dilithium_ed448_pk

Dilithium public key.

Definition at line 1368 of file lc_dilithium.h.

Data Fields
enum lc_dilithium_type dilithium_type
union lc_dilithium_ed448_pk.key key

◆ lc_dilithium_ed448_sig

struct lc_dilithium_ed448_sig

Dilithium signature.

Definition at line 1386 of file lc_dilithium.h.

Data Fields
enum lc_dilithium_type dilithium_type
union lc_dilithium_ed448_sig.sig sig

◆ lc_dilithium_sk.key

union lc_dilithium_sk.key

Definition at line 109 of file lc_dilithium.h.

◆ lc_dilithium_pk.key

union lc_dilithium_pk.key

Definition at line 127 of file lc_dilithium.h.

◆ lc_dilithium_sig.sig

union lc_dilithium_sig.sig

Definition at line 145 of file lc_dilithium.h.

◆ lc_dilithium_ed25519_sk.key

union lc_dilithium_ed25519_sk.key

Definition at line 785 of file lc_dilithium.h.

◆ lc_dilithium_ed25519_pk.key

union lc_dilithium_ed25519_pk.key

Definition at line 803 of file lc_dilithium.h.

◆ lc_dilithium_ed25519_sig.sig

union lc_dilithium_ed25519_sig.sig

Definition at line 821 of file lc_dilithium.h.

◆ lc_dilithium_ed448_sk.key

union lc_dilithium_ed448_sk.key

Definition at line 1352 of file lc_dilithium.h.

◆ lc_dilithium_ed448_pk.key

union lc_dilithium_ed448_pk.key

Definition at line 1370 of file lc_dilithium.h.

◆ lc_dilithium_ed448_sig.sig

union lc_dilithium_ed448_sig.sig

Definition at line 1388 of file lc_dilithium.h.

Enumeration Type Documentation

◆ lc_dilithium_alg_operation

Enumerator
lc_alg_operation_dilithium_unknown 

Unknown operation

lc_alg_operation_dilithium_keygen 

ML-DSA: key generation operation

lc_alg_operation_dilithium_siggen 

ML-DSA: signature generation operation

lc_alg_operation_dilithium_sigver 

ML-DSA: signature generation operation

Definition at line 734 of file lc_dilithium.h.

◆ lc_dilithium_type

Enumerator
LC_DILITHIUM_UNKNOWN 

Unknown key type

LC_DILITHIUM_87 

Dilithium 87

LC_DILITHIUM_65 

Dilithium 65

LC_DILITHIUM_44 

Dilithium 44

Definition at line 59 of file lc_dilithium.h.

Function Documentation

◆ lc_dilithium_pct()

int lc_dilithium_pct ( const struct lc_dilithium_pk *  pk,
const struct lc_dilithium_sk *  sk 
)

Pairwise consistency check as per FIPS 140 IG.

This call should be invoked after generating a key pair in FIPS mode

Parameters
[in]pkPublic key
[in]skSecret key
Returns
0 on success, < 0 on error