Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add ChaCha20Poly1305 support to HPKE implementation#14393

Merged
reaperhulk merged 1 commit intomainfrom
claude/add-chacha20poly1305-hpke-K1ODS
Mar 1, 2026
Merged

Add ChaCha20Poly1305 support to HPKE implementation#14393
reaperhulk merged 1 commit intomainfrom
claude/add-chacha20poly1305-hpke-K1ODS

Conversation

@alex
Copy link
Member

@alex alex commented Feb 28, 2026

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

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
@alex alex mentioned this pull request Feb 28, 2026
12 tasks
@reaperhulk reaperhulk merged commit a6cabfa into main Mar 1, 2026
67 checks passed
@reaperhulk reaperhulk deleted the claude/add-chacha20poly1305-hpke-K1ODS branch March 1, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants