Skip to content

Conversation

fpseverino
Copy link
Contributor

Generalises the definition of ML-DSA algorithms with GYB to allow the addition of other parameter sets in the future

Checklist

  • I've run tests to see all new and existing tests pass
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

If you've made changes to gyb files

  • I've run .script/generate_boilerplate_files_with_gyb and included updated generated files in a commit of this pull request

Motivation:

BoringSSL recently made ML-DSA-87 public in its API, in addition to ML-DSA-65 which has already been integrated into Swift Crypto.
By generating the code with GYB we will be able to add support for ML-DSA-87 very easily in the future when the vendored version of BoringSSL is updated.

Modifications:

Generate the code for MLDSA65 (and in future also for MLDSA87) with GYB.

Result:

Nothing changes in the public API, but adding MLDSA87 in the future will be instantaneous.

@glbrntt
Copy link
Contributor

glbrntt commented May 19, 2025

Thanks for opening this PR. The maintainer of this project is currently out of office so won't get to it for a little while.

Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the lengthy delay here. Very nice, this LGTM! I'll see if I can follow-up with a quick update to BoringSSL to get this out the door.

@Lukasa Lukasa added the 🔨 semver/patch No public API change. label Jun 3, 2025
@Lukasa Lukasa enabled auto-merge (squash) June 3, 2025 19:24
auto-merge was automatically disabled June 3, 2025 19:28

Head branch was pushed to by a user without write access

@Lukasa Lukasa merged commit 0d32399 into apple:main Jun 4, 2025
29 of 30 checks passed
@fpseverino fpseverino deleted the mldsa-gyb branch June 4, 2025 08:28
@fpseverino fpseverino mentioned this pull request Jun 4, 2025
5 tasks
Lukasa pushed a commit that referenced this pull request Jun 4, 2025
Add ML-DSA-87

### Checklist
- [X] I've run tests to see all new and existing tests pass
- [X] I've followed the code style of the rest of the project
- [X] I've read the [Contribution Guidelines](CONTRIBUTING.md)
- [X] I've updated the documentation if necessary

#### If you've made changes to `gyb` files
- [X] I've run `.script/generate_boilerplate_files_with_gyb` and
included updated generated files in a commit of this pull request

### Motivation:

See #355 

### Modifications:

Add the "87" parameter set in MLDSA_boring.swift.gyb, add tests for
`MLDSA87` and update the test vectors for both ML-DSA 65 and 87

### Result:

`MLDSA87` is now available
glbrntt added a commit to glbrntt/swift-crypto that referenced this pull request Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants