|
Embedded SDK
Embedded SDK
|
ML-DSA internal functions for testing (FIPS 204). More...
#include <string.h>#include "lcx_mldsa.h"#include "cx_mldsa_internal.h"#include "cx_mldsa_poly.h"#include "cx_mldsa_polyvec.h"#include "cx_mldsa_polymat.h"#include "cx_mldsa_sample.h"#include "cx_mldsa_packing.h"#include "cx_mldsa_rounding.h"#include "cx_mldsa_util.h"
Go to the source code of this file.
Functions | |
| 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). | |
ML-DSA internal functions for testing (FIPS 204).
These functions expose deterministic key generation, signing, and verification entry points intended only for conformance testing. They should not be called directly in production code.
Definition in file cx_mldsa_internal.c.
| 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_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.