Skip to content

sntrup761: replace PQClean code with public domain OpenSSH code#2356

Open
bbbrumley wants to merge 11 commits intoopen-quantum-safe:mainfrom
bbbrumley:bbb_sntrup
Open

sntrup761: replace PQClean code with public domain OpenSSH code#2356
bbbrumley wants to merge 11 commits intoopen-quantum-safe:mainfrom
bbbrumley:bbb_sntrup

Conversation

@bbbrumley
Copy link

PQClean does not support sntrup761 anymore, since it did not proceed in the NIST standardization process. The liboqs code for sntrup761 needs updating, so it makes sense to ditch the PQClean code and go with "something else."

sntrup761 remains relevant for many reasons, IMO the most significant being its (standardized) use in SSH key exchange. (OK, maybe it's a draft rn, but it's deployed, keys are out there, and they're only growing, the details are historical footnotes.)

In this case, OpenSSH maintains a public domain single-file implementation. (Big props upstream! Thank you for your contribution.)

So this PR removes the PQClean code for sntrup761 and shims in that OpenSSH code.

Fixes #2324.

This is not a new feature.

  • [N] Does this PR change the input/output behaviour of a cryptographic algorithm (i.e., does it change known answer test values)? (If so, a version bump will be required from x.y.z to x.(y+1).0.)
  • [N] Does this PR change the list of algorithms available -- either adding, removing, or renaming? Does this PR otherwise change an API? (If so, PRs in fully supported downstream projects dependent on these, i.e., oqs-provider will also need to be ready for review and merge by the time this is merged. Also, make sure to update the list of algorithms in the continuous benchmarking files: .github/workflows/kem-bench.yml and sig-bench.yml)

I think this change is transparent to linking applications. But idk liboqs that well, just my best guess.

No AI.

@bbbrumley
Copy link
Author

I don't really know what that DCO check means, I added the string to the commit message, idk if that was correct 🤷

@coveralls
Copy link

coveralls commented Feb 10, 2026

Coverage Status

coverage: 82.799% (-0.2%) from 82.96%
when pulling eb5ccc2 on bbbrumley:bbb_sntrup
into c58e93e on open-quantum-safe:main.

@bbbrumley
Copy link
Author

bbbrumley commented Feb 10, 2026

0764558 should solve some of the CI failures. Will take a look at what's still failing after the CI runs.

@bbbrumley
Copy link
Author

... and @dstebila thank you for the push

@bbbrumley
Copy link
Author

Thanks for your patience while I stumble through your CI!

@baentsch
Copy link
Member

Thanks for your patience while I stumble through your CI!

Thanks for your willingness to do that. Just triggered a full run.

Copy link
Member

@baentsch baentsch left a comment

Choose a reason for hiding this comment

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

One quick initial comment on the PR: Could you please also amend the ntruprime files in the folder https://github.com/open-quantum-safe/liboqs/tree/main/docs/algorithms/kem as part of the PR? Those files had been auto-generated while importing from PQClean -- but that obviously now no longer works.... If at all possible, please retain the format but replace everything that no longer applies (optimizations, license info, etc.). Thanks in advance!

@bbbrumley
Copy link
Author

bbbrumley commented Feb 11, 2026

Could you please also amend the ntruprime files in the folder

@baentsch absolutely, I saw those but wasn't sure exactly what the procedure is -- does the md get generated from the yml or are these independent files? Just so I know what to edit.

@dstebila
Copy link
Member

Could you please also amend the ntruprime files in the folder

@baentsch absolutely, I saw those but wasn't sure exactly what the procedure is -- does the md get generated from the yml or are these independent files? Just so I know what to edit.

Yes, the Markdown gets generated from the YAML file by the copy_from_upstream script.

@dstebila
Copy link
Member

Thanks for your patience while I stumble through your CI!

Let us know if we can help with that. Although my own expertise with the Windows builds (which are the ones currently failing) is low.

@bbbrumley
Copy link
Author

Let us know if we can help with that

will do, making progress. (I think I'm almost there, also no direct windows experience since early 2000s ...)

@bbbrumley bbbrumley force-pushed the bbb_sntrup branch 2 times, most recently from 95ff834 to e7204bc Compare February 12, 2026 08:56
bbbrumley and others added 10 commits February 18, 2026 02:10
Signed-off-by: Billy Brumley <bbb@iki.fi>
Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>
…ake stricter android ld.lld happy

Signed-off-by: Billy Brumley <bbb@iki.fi>
Signed-off-by: Billy Brumley <bbb@iki.fi>
…able length arrays

Signed-off-by: Billy Brumley <bbb@iki.fi>
…th arrays on the stack; script to modify upstream source

Signed-off-by: Billy Brumley <bbb@iki.fi>
Signed-off-by: Billy Brumley <bbb@iki.fi>
Signed-off-by: Billy Brumley <bbb@iki.fi>
@bbbrumley
Copy link
Author

Yes, the Markdown gets generated from the YAML file by the copy_from_upstream script

Ah I see, I think I got it now, changes from running that script like the CI does are in 89eeb44

Also rebased on current main

Signed-off-by: Billy Brumley <bbb@iki.fi>
@bbbrumley
Copy link
Author

If you need a GH handle for sntrup761 going forward, I added myself in 6edba19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#define p 761 conflicts with Termux variant of Android NDK, preventing build for Termux

4 participants