Skip to content

Conversation

@MkDev11
Copy link
Contributor

@MkDev11 MkDev11 commented Jan 12, 2026

Add HPKE RFC 9180 test vectors

Description

Add official HPKE test vectors from the IETF CFRG specification (RFC 9180).

Test Vector Coverage

These vectors include:

  • 128 test cases covering all 4 modes:
    • Mode 0: Base
    • Mode 1: PSK
    • Mode 2: Auth
    • Mode 3: AuthPSK
  • Multiple KEMs:
    • DHKEM(X25519, HKDF-SHA256) - kem_id: 0x0020
    • DHKEM(X448, HKDF-SHA512) - kem_id: 0x0021
    • DHKEM(P-256, HKDF-SHA256) - kem_id: 0x0010
    • DHKEM(P-521, HKDF-SHA512) - kem_id: 0x0012
  • Multiple KDFs:
    • HKDF-SHA256 - kdf_id: 0x0001
    • HKDF-SHA512 - kdf_id: 0x0003
  • Multiple AEADs:
    • AES-128-GCM - aead_id: 0x0001
    • AES-256-GCM - aead_id: 0x0002
    • ChaCha20Poly1305 - aead_id: 0x0003
    • Export-only - aead_id: 0xFFFF

Source

Test vectors obtained from the official IETF CFRG HPKE repository:
https://github.com/cfrg/draft-irtf-cfrg-hpke/blob/master/test-vectors.json

Related


Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=94194147

Add official test vectors from the IETF CFRG HPKE specification.
These vectors cover all modes, KEMs, KDFs, and AEADs defined in RFC 9180.
@MkDev11
Copy link
Contributor Author

MkDev11 commented Jan 12, 2026

@alex please review the PR and let me know your feedback. thanks

@alex
Copy link
Member

alex commented Jan 12, 2026

Please document the vectors in test-vectors.rst

@MkDev11
Copy link
Contributor Author

MkDev11 commented Jan 12, 2026

Please document the vectors in test-vectors.rst

Done!

@MkDev11 MkDev11 changed the title Add HPKE RFC 9180 test vectors Add HPKE RFC 9180 vectors Jan 12, 2026
@MkDev11 MkDev11 changed the title Add HPKE RFC 9180 vectors Add HPKE RFC 9180 test vectors Jan 12, 2026
Copy link
Member

@alex alex left a comment

Choose a reason for hiding this comment

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

lgtm, thanks! just waiting for confirmation that even though the repo says "draft" the vectors are valid for the final RFC

@alex
Copy link
Member

alex commented Jan 12, 2026

(I've asked the draft authors, so nothing is required from you -- hopefully will merge shortly)

@alex alex merged commit 3b21766 into pyca:main Jan 12, 2026
67 checks passed
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.

2 participants