Skip to content

Support for seed-only ML-DSA private key serialization format #720

@jgrateron

Description

@jgrateron

Context:
Currently, KeyStore Explorer serializes ML-DSA private keys (e.g., ML-DSA-44) using the both option from the ASN.1 CHOICE defined in RFC 9881, which includes both the seed (32 bytes) and the expanded key (2560 bytes). This results in a key object of ~2592 bytes.

Problem:
This choice is not viable for environments with strict persistent storage constraints, such as:

  • HSMs (Hardware Security Modules)
  • Smart cards
  • Resource-constrained embedded firmware

In these environments, storing 2.5 KB+ per key is prohibitive compared to alternatives like ECC (32 bytes) or even RSA (256 bytes).

Proposal:
Implement the ability to choose the serialization format for ML-DSA private keys, according to the RFC 9881 options:

  1. seed (32 bytes) – ideal for HSM storage.
  2. expandedKey (2560 bytes) – generally not recommended.
  3. both (2592 bytes) – currently implemented, good for software performance.

Functional requirements:

  • Allow import/export of keys in the seed format (ASN.1 tag [0]).
  • Keep both as the default for compatibility and general performance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions