Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/configs/pq-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
"--enable-slhdsa=yes,small", "--enable-dilithium=yes,small",
"--enable-dual-alg-certs", "--disable-qt",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DWOLFCRYPT_TEST_LINT -DNO_WOLFSSL_CIPHER_SUITE_TEST -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFSSL_MLKEM_MAKEKEY_SMALL_MEM -DWOLFSSL_MLKEM_ENCAPSULATE_SMALL_MEM -DWOLFSSL_MLKEM_NO_LARGE_CODE -DWOLFSSL_MLDSA_SIGN_SMALL_MEM -DWOLFSSL_MLDSA_VERIFY_SMALL_MEM -DWOLFSSL_MLDSA_MAKE_KEY_SMALL_MEM -DWOLFSSL_MLDSA_NO_LARGE_CODE"]},
{"name": "pq-nonblock-smallmem", "minutes": 4.0,
"comment": "Non-blocking ML-DSA (WC_MLDSA_NONBLOCK) and ML-KEM (WC_MLKEM_NONBLOCK) built on the small-mem paths. make check runs mldsa_nonblock_test and mlkem_nonblock_test, which drive each operation's resumable MP_WOULDBLOCK state machine and confirm the result matches the blocking path.",
"configure": ["--enable-dilithium=yes,small", "--enable-mlkem",
"--enable-experimental",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DWOLFSSL_MLDSA_SIGN_SMALL_MEM -DWOLFSSL_MLDSA_VERIFY_SMALL_MEM -DWOLFSSL_MLDSA_MAKE_KEY_SMALL_MEM -DWOLFSSL_MLDSA_NO_LARGE_CODE -DWC_MLDSA_NONBLOCK -DWOLFSSL_MLKEM_MAKEKEY_SMALL_MEM -DWOLFSSL_MLKEM_ENCAPSULATE_SMALL_MEM -DWC_MLKEM_NONBLOCK"]},
{"name": "pq-nonblock-smallmem-dynkeys", "minutes": 2.5,
"comment": "Non-blocking ML-KEM with the cached matrix A and dynamic key buffers: a resumed keygen must keep the vectors its first slice allocated, and encapsulation must read the cached matrix across yields",
"configure": ["--enable-cryptonly", "--enable-mlkem", "--enable-smallstack",
"CPPFLAGS=-DWOLFSSL_MLKEM_MAKEKEY_SMALL_MEM -DWOLFSSL_MLKEM_ENCAPSULATE_SMALL_MEM -DWC_MLKEM_NONBLOCK -DWOLFSSL_MLKEM_CACHE_A -DWOLFSSL_MLKEM_DYNAMIC_KEYS"]},
{"name": "slhdsa-pqc-only", "minutes": 22.3,
"comment": "PQC-only TLS 1.3: ML-KEM key exchange + SLH-DSA (FIPS 205) auth with RSA, ECC and DH disabled; exercises the SLH-DSA CertificateVerify path",
"configure": ["--enable-mlkem", "--enable-slhdsa",
Expand Down
30 changes: 20 additions & 10 deletions doc/dox_comments/header_files/wc_mldsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -672,9 +672,11 @@ int wc_MlDsaKey_Verify(wc_MlDsaKey* key, const byte* sig, word32 sigLen,
/*!
\ingroup ML_DSA

\brief Returns the size in bytes of the encoded private key for
the parameter set selected on this key. Equivalent to
wc_MlDsaKey_PrivSize() and provided for API compatibility.
\brief Returns the size in bytes of the encoded private key alone
(FIPS 204 sk) for the parameter set selected on this key. This is
the length wc_MlDsaKey_ExportPrivRaw() writes and
wc_MlDsaKey_ImportPrivRaw() expects. It is not the same value as
wc_MlDsaKey_PrivSize(), which includes the public key.

\return Encoded private key size in bytes on success (positive
value).
Expand All @@ -692,15 +694,21 @@ int wc_MlDsaKey_Size(wc_MlDsaKey* key);
/*!
\ingroup ML_DSA

\brief Returns the size in bytes of the encoded private key for
the parameter set selected on this key.
\brief Returns the size in bytes of the encoded private key with the
encoded public key appended, for the parameter set selected on this
key. This is wc_MlDsaKey_Size() plus wc_MlDsaKey_PubSize(), the
length of the private-plus-public encoding that
wc_MlDsaKey_ImportKey() and wc_MlDsaKey_PrivateKeyDecode() accept.
The name is kept for compatibility with wc_dilithium_priv_size().

\return Encoded private key size on success (positive value).
\return Encoded private-plus-public key size on success (positive
value).
\return BAD_FUNC_ARG if key is NULL or no parameter set is
selected.

\param [in] key Pointer to a wc_MlDsaKey with parameters set.

\sa wc_MlDsaKey_Size
\sa wc_MlDsaKey_PubSize
\sa wc_MlDsaKey_GetPrivLen
*/
Expand Down Expand Up @@ -743,18 +751,20 @@ int wc_MlDsaKey_SigSize(wc_MlDsaKey* key);
/*!
\ingroup ML_DSA

\brief Writes the encoded private key size into *len. Equivalent
information to wc_MlDsaKey_PrivSize() but uses an out-parameter
style.
\brief Writes the size of the encoded private key with the public
key appended into *len. Equivalent information to
wc_MlDsaKey_PrivSize() but uses an out-parameter style. For the
private key alone use wc_MlDsaKey_Size().

\return 0 on success.
\return BAD_FUNC_ARG if key or len is NULL, or no parameter set is
selected.

\param [in] key Pointer to a wc_MlDsaKey with parameters set.
\param [out] len Receives the private key size in bytes.
\param [out] len Receives the private-plus-public key size in bytes.

\sa wc_MlDsaKey_PrivSize
\sa wc_MlDsaKey_Size
*/
int wc_MlDsaKey_GetPrivLen(wc_MlDsaKey* key, int* len);

Expand Down
3 changes: 3 additions & 0 deletions tests/api/test_mldsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,9 @@ int test_mldsa(void)
ExpectIntEQ(wc_MlDsaKey_Size(key), WC_MLDSA_87_KEY_SIZE);
#ifdef WOLFSSL_MLDSA_PUBLIC_KEY
ExpectIntEQ(wc_MlDsaKey_PrivSize(key), WC_MLDSA_87_PRV_KEY_SIZE);
/* PrivSize is the private key with the public key appended. */
ExpectIntEQ(wc_MlDsaKey_PrivSize(key),
wc_MlDsaKey_Size(key) + wc_MlDsaKey_PubSize(key));
#endif
#endif
#ifdef WOLFSSL_MLDSA_PUBLIC_KEY
Expand Down
Loading
Loading