pyca / pyca/cryptography

SLH-DSA support

Open
#14,419 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.8k
Forks
1.8k
Avg merge
7h 48m
Merged PRs (30d)
157

Description

In order to add the support for SLH-DSA in cryptography, I've started to work on adding the test vectors.

However, this PQ algorithm has a signature size issue.

The test vectors from NIST are quite heavy:

Of note, wycheproof has no test vectors for SLH-DSA.

I know the trailofbits/go-slh-dsa uses as tests the full JSON files, but I'm unsure if we want to commit 70 MB of test files in this repo.

If we limit our support to BoringSSL (headers), then we can significantly trim down the number of test vectors:

  • sigVer vectors for SLH-DSA-SHA2-128s and SLH-DSA-SHAKE-256f (the only two parameter sets BoringSSL exposes).
  • Pure, external interface only (matching what SLHDSA_*_verify accepts).
  • 14 tests per parameter set, mix of valid and invalid signatures.
  • Total size: about 1.8MB

It excludes:

  • keyGen vectors: BoringSSL API does not expose a way to generate a key from a seed
  • sigGen vectors: BoringSSL only supports randomized signing - deterministic vectors cannot be verified
  • other parameter sets
  • prehash vectors
  • internal vectors

But, if / when we support another backend (e.g. OpenSSL), we would have to extend those test vectors.

I see several paths forward (rough size estimates in parentheses):

  • Keep the whole vectors files (unnecessarily large)
  • Keep the whole vectors files but trim down internal and prehash versions (15MB)
  • Keep only 2 tests per parameter set, down from 14 (3MB)
  • Keep only 1 test per parameter set (1.5MB)
  • Trim the test vectors to only test the prefix/suffix of the signature (?) - the most compact, but also somewhat unsatisfying

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked NIST ACVP SLH-DSA sigGen, keyGen, and sigVer vectors alongside the BoringSSL SLH-DSA API constraints described in the issue. The work is not ready to implement until a vector-size and backend-coverage approach is chosen; done would mean adding SLH-DSA support tests that match that decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cryptography, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.