Fix ML-DSA example in docs

pull/143/head
Eric Blankenhorn 2026-08-07 14:11:45 -05:00
parent e1bdcab5ea
commit 58520ace10
3 changed files with 8 additions and 6 deletions

View File

@ -144,8 +144,8 @@ ML-DSA
>>>
>>> msg = b"This is an example message"
>>>
>>> sig = mldsa_priv.sign(msg)
>>> mldsa_pub.verify(sig, msg)
>>> sig = mldsa_priv.sign(msg, ctx=b"")
>>> mldsa_pub.verify(sig, msg, ctx=b"")
True
>>>
>>> ######## Export and Import Keys
@ -160,6 +160,6 @@ True
>>> mldsa_pub2 = MlDsaPublic(mldsa_type)
>>> mldsa_pub2.decode_key(exported_pub_key)
>>>
>>> sig2 = mldsa_priv2.sign(msg)
>>> mldsa_pub2.verify(sig2, msg)
>>> sig2 = mldsa_priv2.sign(msg, ctx=b"")
>>> mldsa_pub2.verify(sig2, msg, ctx=b"")
True

@ -1 +1 @@
Subproject commit ac01707f552c611fbd135cc723b2682b3e7f80f2
Subproject commit 59f4fa568615396fbf381b073b220d1e8d61e4c2

View File

@ -235,7 +235,9 @@ def make_flags(prefix, fips):
# ML-KEM
flags.append("--enable-mlkem")
# ML-DSA (note: to be able to use the legacy option of signing without context, pass `yes,no-ctx` as argument)
# ML-DSA (note: to be able to use the legacy option of signing without context, pass `yes,draft` as
# argument -- wolfSSL has no `no-ctx` option; `draft` defines WOLFSSL_DILITHIUM_FIPS204_DRAFT, which
# also switches to the pre-FIPS-204 draft signature format)
flags.append("--enable-mldsa=yes")
# disabling other configs enabled by default