Add ChaCha20Poly1305 support to HPKE implementation#14393
Merged
reaperhulk merged 1 commit intomainfrom Mar 1, 2026
Merged
Conversation
Add CHACHA20_POLY1305 as an AEAD option for HPKE (RFC 9180 aead_id 0x0003), alongside the existing AES_128_GCM support. Changes: - Add CHACHA20_POLY1305 variant to the HPKE AEAD enum with parameters (Nk=32, Nn=12, Nt=16) - Make Suite store the selected AEAD and dynamically dispatch to the correct cipher for encrypt/decrypt operations - Make key_schedule return PyBytes directly to avoid unnecessary allocations when passing to AEAD constructors - Make ChaCha20Poly1305 struct and its encrypt/decrypt methods pub(crate) so they can be used from the HPKE module - Update tests to cover ChaCha20Poly1305 roundtrips and RFC 9180 test vector validation - Update type stubs and documentation https://claude.ai/code/session_019vzyAZNnzXmtyAnkc9BHZp
reaperhulk
approved these changes
Mar 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add CHACHA20_POLY1305 as an AEAD option for HPKE (RFC 9180 aead_id 0x0003), alongside the existing AES_128_GCM support.
Changes:
https://claude.ai/code/session_019vzyAZNnzXmtyAnkc9BHZp