Skip to content

Upgrade to HPKE v0.14#109

Merged
tgeoghegan merged 10 commits into
divviup:mainfrom
rozbb:upgrade-hpke
Jul 13, 2026
Merged

Upgrade to HPKE v0.14#109
tgeoghegan merged 10 commits into
divviup:mainfrom
rozbb:upgrade-hpke

Conversation

@rozbb

@rozbb rozbb commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Making this to start the conversation about how to upgrade. Right now it's the absolute minimum possible diff to do the upgrade. But I suspect you might want to change your own feature flags to match the new ones upstream, and also maybe add some to expose the new PQ and hybrid ciphersuites. Let me know what you're thinking

@rozbb
rozbb requested a review from a team as a code owner July 9, 2026 21:05
@tgeoghegan

tgeoghegan commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR, Michael.

IMO this crate's goal is just to be an adapter to hpke that allows runtime dispatch. If we introduce any abstractions on top of hpke, like a different set of features, we're doing a disservice to users by getting in the way of what they really want to do. So what I mean by all that is: we should harmonize hpke-dispatch's features with hpke.

We will also need to update the discussion of features in README.md before merging.

And wiring up PQ and hybrid HPKE is worthwhile.

Comment thread Cargo.toml
@tgeoghegan
tgeoghegan requested a review from a team July 10, 2026 14:34
@rozbb

rozbb commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Great, I can make those changes 👍

@tgeoghegan

Copy link
Copy Markdown
Contributor

Thanks, but let's see if @jcjones or @divergentdave have an opinion to share before we make another move.

@divergentdave divergentdave left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Mirroring hpke's features and forwarding them sounds good. Our existing per-algorithm features may have gone a bit overboard.

Comment thread Cargo.toml
@rozbb

rozbb commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

Aligned features and added new KEMs and KDFs. Lmk if there's anything else you'd like. I realized that I'm missing MLKEM-512. I'll add that in a future version. I'm not in much of a rush

@rozbb

rozbb commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

One question: is it necessary to feature-gate base_mode_open/base_mode_seal? What's the reason to omit those?

- normalize feature names with hpke
- remove base-mode-open, base-mode-seal features
- update README
- tidy up some doccomments
@tgeoghegan

Copy link
Copy Markdown
Contributor

Thanks, Michael.

IMO we should align our feature flags as much as possible with hpke so that we're as unsurprising as possible. To that end, I think we should remove the aead-, kdf- and kem- prefixes.

One question: is it necessary to feature-gate base_mode_open/base_mode_seal? What's the reason to omit those?

It doesn't seem useful to omit these, especially since users of hpke-dispatch pull in hpke no matter what. I think we should take the opportunity to remove these features.

I pushed a commit that does the above two things, as well as updating README.md and cleaning up some doccomments.

Separately from this PR, we should extend tests/test_vectors.json to include test cases for PQ and hybrid combiners: #110

@tgeoghegan
tgeoghegan requested a review from divergentdave July 13, 2026 14:41
@tgeoghegan

Copy link
Copy Markdown
Contributor

I changed my mind: adding the PQ test vectors is so easy that I think we can just do it here. It's only a few lines of code, plus 122 kB of JSON imported from hpke-pq.

Comment thread .github/workflows/ci.yaml Outdated
# Check using Clippy with the feature combinations listed in the README.
- run: cargo clippy
- run: cargo clippy --no-default-features --features algo-all,base-mode-open,serde
- run: cargo clippy --no-default-features --features algo-all,serde

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The feature list at the end of the README is now ["aes", "hkdfsha2", "nistp", "serde"]

Comment thread Cargo.toml Outdated
Comment thread src/kdf.rs Outdated
Comment on lines +29 to +32
/// SHAKE128 [RFC 9861](https://www.rfc-editor.org/info/rfc9861/)
#[cfg(feature = "shake")]
Shake128 = 0x0010,
/// SHAKE256 [RFC 9861](https://www.rfc-editor.org/info/rfc9861/)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think these are just defined in FIPS 202

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should still reference RFC 9861 for TurboSHAKE128 and TurboSHAKE256

@tgeoghegan
tgeoghegan enabled auto-merge (squash) July 13, 2026 17:48
@tgeoghegan
tgeoghegan merged commit 3ee1194 into divviup:main Jul 13, 2026
7 checks passed
@tgeoghegan

Copy link
Copy Markdown
Contributor

Merged -- thank you for the contribution, @rozbb, as well as your continued hard work on HPKE!

@rozbb
rozbb deleted the upgrade-hpke branch July 14, 2026 08:38
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.

3 participants