|
Embedded SDK
Embedded SDK
|
#include "lcx_mldsa.h"

Go to the source code of this file.
Typedefs | |
| typedef struct MLDSA_formatted_message_s | MLDSA_formatted_message_t |
Functions | |
| cx_err_t | MLDSA_internal_sign_core (uint8_t *sig, size_t sig_len, size_t *sig_actual_len, const MLDSA_formatted_message_t *formatted_mprime, const uint8_t *precomputed_mu, uint8_t *rnd, size_t rnd_len, const uint8_t *sk, size_t sk_len, MLDSA_param_t param) |
| Core ML-DSA signing routine (FIPS 204, Algorithms 2 & 7). | |
| cx_err_t | MLDSA_internal_verify_core (const uint8_t *sig, size_t sig_len, const MLDSA_formatted_message_t *formatted_mprime, const uint8_t *precomputed_mu, const uint8_t *pk, size_t pk_len, MLDSA_param_t param) |
| Core ML-DSA verification routine (FIPS 204, Algorithms 3 & 8). | |
| cx_err_t | MLDSA_internal_keygen (uint8_t *pk, size_t pk_len, uint8_t *sk, size_t sk_len, const uint8_t seed[MLDSA_SEEDBYTES], MLDSA_param_t param) |
| Generates an ML-DSA key pair from a seed (deterministic). | |
| cx_err_t | MLDSA_internal_sign (uint8_t *sig, size_t sig_len, size_t *sig_actual_len, const uint8_t *mu, uint8_t *rnd, size_t rnd_len, const uint8_t *sk, size_t sk_len, MLDSA_param_t param) |
| Internal ML-DSA signature generation (FIPS 204, Algorithms 2 & 7). | |
| cx_err_t | MLDSA_internal_verify (const uint8_t *sig, size_t sig_len, const uint8_t *mu, const uint8_t *pk, size_t pk_len, MLDSA_param_t param) |
| Internal ML-DSA signature verification (FIPS 204, Algorithms 3 & 8). | |
| typedef struct MLDSA_formatted_message_s MLDSA_formatted_message_t |
Definition at line 21 of file cx_mldsa_internal.h.
| cx_err_t MLDSA_internal_keygen | ( | uint8_t * | pk, |
| size_t | pk_len, | ||
| uint8_t * | sk, | ||
| size_t | sk_len, | ||
| const uint8_t | seed[MLDSA_SEEDBYTES], | ||
| MLDSA_param_t | param | ||
| ) |
Generates an ML-DSA key pair from a seed (deterministic).
| [out] | pk | Public key output buffer. |
| [in] | pk_len | Size of the public key buffer in bytes. |
| [out] | sk | Secret key output buffer. |
| [in] | sk_len | Size of the secret key buffer in bytes. |
| [in] | seed | Random seed of MLDSA_SEEDBYTES bytes. |
| [in] | param | ML-DSA parameter set selector. |
Definition at line 49 of file cx_mldsa_internal.c.
| cx_err_t MLDSA_internal_sign | ( | uint8_t * | sig, |
| size_t | sig_len, | ||
| size_t * | sig_actual_len, | ||
| const uint8_t * | mu, | ||
| uint8_t * | rnd, | ||
| size_t | rnd_len, | ||
| const uint8_t * | sk, | ||
| size_t | sk_len, | ||
| MLDSA_param_t | param | ||
| ) |
Internal ML-DSA signature generation (FIPS 204, Algorithms 2 & 7).
Signs a message whose mu value has already been computed by the caller. Unlike MLDSA_sign(), this function does not perform message formatting or context string handling.
| [out] | sig | Signature output buffer. |
| [in] | sig_len | Size of the signature buffer in bytes. |
| [out] | sig_actual_len | Actual signature length written. |
| [in] | mu | Pre-computed message representative (MLDSA_CRHBYTES bytes). |
| [in] | rnd | Signing randomness buffer (MLDSA_RNDBYTES bytes). |
| [in] | rnd_len | Length of the randomness buffer in bytes. |
| [in] | sk | Secret key. |
| [in] | sk_len | Secret key length in bytes. |
| [in] | param | ML-DSA parameter set selector. |
Definition at line 153 of file cx_mldsa_internal.c.
| cx_err_t MLDSA_internal_sign_core | ( | uint8_t * | sig, |
| size_t | sig_len, | ||
| size_t * | sig_actual_len, | ||
| const MLDSA_formatted_message_t * | formatted_mprime, | ||
| const uint8_t * | precomputed_mu, | ||
| uint8_t * | rnd, | ||
| size_t | rnd_len, | ||
| const uint8_t * | sk, | ||
| size_t | sk_len, | ||
| MLDSA_param_t | param | ||
| ) |
Core ML-DSA signing routine (FIPS 204, Algorithms 2 & 7).
Performs the rejection-sampling signing loop. Accepts either a formatted message formatted_mprime (from which mu is derived) or a pre-computed precomputed_mu; exactly one must be non-NULL.
| [out] | sig | Signature output buffer. |
| [in] | sig_len | Size of the signature buffer in bytes. |
| [out] | sig_actual_len | Actual signature length written on success. |
| [in] | formatted_mprime | Formatted message M' (NULL when using precomputed_mu). |
| [in] | precomputed_mu | Pre-computed mu (NULL when using formatted_mprime). |
| [in] | rnd | Signing randomness (MLDSA_RNDBYTES), or NULL for deterministic signing. |
| [in] | rnd_len | Length of rnd (must be MLDSA_RNDBYTES or 0 if NULL). |
| [in] | sk | Secret key. |
| [in] | sk_len | Secret key length in bytes. |
| [in] | param | ML-DSA parameter set selector. |
Definition at line 317 of file cx_mldsa.c.
| cx_err_t MLDSA_internal_verify | ( | const uint8_t * | sig, |
| size_t | sig_len, | ||
| const uint8_t * | mu, | ||
| const uint8_t * | pk, | ||
| size_t | pk_len, | ||
| MLDSA_param_t | param | ||
| ) |
Internal ML-DSA signature verification (FIPS 204, Algorithms 3 & 8).
Verifies a signature given a pre-computed message representative mu. Unlike MLDSA_verify(), this function does not perform message formatting or context string handling.
| [in] | sig | Signature to verify. |
| [in] | sig_len | Signature length in bytes. |
| [in] | mu | Pre-computed message representative (MLDSA_CRHBYTES bytes). |
| [in] | pk | Public key. |
| [in] | pk_len | Public key length in bytes. |
| [in] | param | ML-DSA parameter set selector. |
Definition at line 174 of file cx_mldsa_internal.c.
| cx_err_t MLDSA_internal_verify_core | ( | const uint8_t * | sig, |
| size_t | sig_len, | ||
| const MLDSA_formatted_message_t * | formatted_mprime, | ||
| const uint8_t * | precomputed_mu, | ||
| const uint8_t * | pk, | ||
| size_t | pk_len, | ||
| MLDSA_param_t | param | ||
| ) |
Core ML-DSA verification routine (FIPS 204, Algorithms 3 & 8).
Verifies an ML-DSA signature. Accepts either a formatted message formatted_mprime (from which mu is derived) or a pre-computed precomputed_mu; exactly one must be non-NULL.
| [in] | sig | Signature to verify. |
| [in] | sig_len | Signature length in bytes. |
| [in] | formatted_mprime | Formatted message M' (NULL when using precomputed_mu). |
| [in] | precomputed_mu | Pre-computed mu (NULL when using formatted_mprime). |
| [in] | pk | Public key. |
| [in] | pk_len | Public key length in bytes. |
| [in] | param | ML-DSA parameter set selector. |
Definition at line 577 of file cx_mldsa.c.