cryptography icon indicating copy to clipboard operation
cryptography copied to clipboard

SLH-DSA support

Open DarkaMaul opened this issue 8 months ago • 7 comments

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

DarkaMaul avatar Mar 04 '26 14:03 DarkaMaul

This is fine as a tracking issue, but given limited maintainer bandwidth let's focus on landing ML-DSA with a single backend before moving to another algorithm.

reaperhulk avatar Mar 04 '26 14:03 reaperhulk

Is BoringSSL going to be preferred going forward?

DemiMarie avatar Mar 05 '26 10:03 DemiMarie

hey, @DarkaMaul thanks for reporting this. If you're comfortable, I'd love to take this. Or are you on it?

dataCenter430 avatar Mar 09 '26 22:03 dataCenter430

If you're comfortable, I'd love to take this. Or are you on it?

I've actually already started digging into this one - happy to see it through. I'll post updates here as I make progress!

DarkaMaul avatar Mar 10 '26 11:03 DarkaMaul

Please also support HashSLH-DSA.

mschulz-at-hilscher avatar Jun 16 '26 10:06 mschulz-at-hilscher

As part of the discussion in #14700

I searched to see where the support for SLH-DSA landed:

It is missing from:

  • AWS-LC (the search returns no results)
  • LibreSSL

I have opened an issue in AWS-LC to ask if they plan to implement it: https://github.com/aws/aws-lc/issues/3305

DarkaMaul avatar Jun 18 '26 07:06 DarkaMaul

Yep, on roadmap for aws-lc!

jakemas avatar Jul 14 '26 18:07 jakemas