Skip to content

Digital signatures

Read the implementations in Python and C.

Ed25519 provides compact classical signatures. ML-DSA-65 provides a standardized post-quantum alternative. Each command signs the exact bytes of the input file and produces a detached binary signature. A verifier needs the original message, signature, and a trusted copy of the signer's public key.

mkdir -p lab
printf 'Release 1.0\n' > lab/release
build/pce keygen mldsa65 lab/signing.pem lab/signing.pub
build/pce sign mldsa65 lab/signing.pem lab/release lab/release.sig
uv run python examples/pce.py verify mldsa65 lab/signing.pub lab/release lab/release.sig

A successful verification exits with status zero. Edit one byte of lab/release and repeat the last command to see verification fail. For Ed25519 select ed25519 on all three commands and generate a new key pair. An Ed25519 signature is 64 bytes. An ML-DSA-65 signature is 3,309 bytes. The ML-DSA example uses pure ML-DSA with an empty context string.

See FIPS 204 and RFC 8032.