Quick Start

Overview

The package currently implements the following FIPS standards:

Standard

Description

FIPS 204 - MLDSA

Module-Lattice-Based Digital Signature Standard

Importing

Import one of the supported ML-DSA parameter sets.

from fips import MLDSA_44

The other available parameter sets are

  • MLDSA_65

  • MLDSA_87

Generating Keys

public_key, secret_key = MLDSA_44.MLDSAKeyGen()

Signing a Message

Messages are signed as bit strings.

message = "is that it!".encode()
context = b'12' # context must be <255 according to the FIPS standard.

signature = MLDSA_44.MLDSASign(
    secret_key,
    MLDSA_44.auxilary.BytesToBits(message),
    context
)

Verifying a Signature

valid = MLDSA_44.MLDSAVerify(
    public_key,
    MLDSA_44.auxilary.BytesToBits(message),
    signature,
    context
)

print(valid)

Expected Output

True

Changing Security Levels

Changing the security level requires only importing a different parameter set.

from fips import MLDSA_65

or

from fips import MLDSA_87

Everything else remains identical across all three parameter sets.

Current Limitations

  • Hash ML-DSA (Algorithms 4 and 5) are not yet implemented.

  • The library prioritizes readability over performance.

  • The implementation should not be considered suitable for production use.