Skip to Content
oxcrypto

FN-DSA

Sign with FN-DSA-512 or FN-DSA-1024 (draft FIPS 206, experimental).

Warning

FN-DSA is experimental: FIPS 206 is still a draft, and signatures may not interoperate with the final standard.

from oxcrypto.signature.fn_dsa import FN_DSA

key = FN_DSA.FN_DSA_512.generate()
signature = key.sign(b"hello", context=b"app v1")
assert key.public_key().verify(signature, b"hello", context=b"app v1")
VariantPrivate keyPublic keySignature
FN_DSA_5121345 bytes897 bytes666 bytes
FN_DSA_10242369 bytes1793 bytes1280 bytes

FN-DSA is experimental. FIPS 206 has not been published, and the upstream crate warns that the final standard may change key encodings, pre-hashing and domain separation, so keys and signatures may not interoperate with it. Do not rely on FN-DSA for long-term keys.

Messages are signed raw with a context string of up to 255 bytes. FN-DSA always uses fresh randomness, so deterministic=True raises ValueError. PKCS#8 and SPKI are not available until OIDs are published, so to_der, to_pem and the DER and PEM loaders raise ValueError.

  • Crate: fn-dsa 0.4.0 by Thomas Pornin, Unlicense, no published audit. It builds with Rust 1.88.
  • Tests: no FN-DSA vectors are published. The tests cover round trips, sizes and rejection of bad input; the crate runs its own known-answer tests.