Skip to content

Add HPKE export-only AEAD support#911

Open
salasebas wants to merge 1 commit into
Legrandin:masterfrom
salasebas:hpke-export-only
Open

Add HPKE export-only AEAD support#911
salasebas wants to merge 1 commit into
Legrandin:masterfrom
salasebas:hpke-export-only

Conversation

@salasebas

Copy link
Copy Markdown

Closes #890

Summary

This adds support for the HPKE export-only AEAD identifier (0xFFFF) from RFC 9180.

Changes:

  • Add HPKE.AEAD.EXPORT_ONLY.
  • Add HPKE_Cipher.export(exporter_context, length).
  • Support HPKE.new(..., aead_id=0xFFFF).
  • Avoid deriving AEAD key/nonce material for export-only contexts.
  • Reject seal() and unseal() on export-only contexts with a clear ValueError.
  • Document the export-only usage pattern.

Tests

  • Added RFC 9180 A.7.1 export-only test vector coverage.
  • Added coverage for integer aead_id=0xFFFF.
  • Added negative coverage for seal()/unseal() on export-only contexts.

Verified with:

env PYTHONPATH=lib python3 -m Crypto.SelfTest.Protocol.test_HPKE
env PYTHONPATH=lib:test_vectors python3 -c "import unittest; from Crypto.SelfTest.Protocol import test_HPKE; suite = unittest.TestSuite(test_HPKE.get_tests({'slow_tests': True})); result = unittest.TextTestRunner().run(suite); raise SystemExit(0 if result.wasSuccessful() else 1)"
git diff --check

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.

HPKE: Support for export-only AEAD ID

1 participant