Skip to content

Commit

Permalink
[feat] Add additional suite - Suite__DHKEM_P384_HKDF_SHA384__HKDF_SHA…
Browse files Browse the repository at this point in the history
…384__AES_256_GCM
  • Loading branch information
jplock authored and ctz committed Sep 1, 2024
1 parent bee5090 commit 6ba7f45
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions hpke/hpke.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,13 @@ class DHKEM_P256_HKDF_SHA256(_DHKEMWeierstrass):
ID = 0x0010


class DHKEM_P384_HKDF_SHA384(_DHKEMWeierstrass):
CURVE = ec.SECP384R1()
KDF = HKDF_SHA384
NSECRET = 48
ID = 0x0011


class DHKEM_P521_HKDF_SHA512(_DHKEMWeierstrass):
CURVE = ec.SECP521R1()
KDF = HKDF_SHA512
Expand Down Expand Up @@ -591,6 +598,16 @@ class Suite__DHKEM_P256_HKDF_SHA256__HKDF_SHA512__AES_128_GCM(_Suite):
AEAD = _AES_128_GCM


class Suite__DHKEM_P384_HKDF_SHA384__HKDF_SHA384__AES_256_GCM(_Suite):
"""
This is DHKEM(P-384, HKDF-SHA384), HKDF-SHA384, AES-256-GCM
"""

KEM = DHKEM_P384_HKDF_SHA384
KDF = HKDF_SHA384
AEAD = _AES_256_GCM


class Suite__DHKEM_P521_HKDF_SHA512__HKDF_SHA512__AES_256_GCM(_Suite):
"""
This is DHKEM(P-521, HKDF-SHA512), HKDF-SHA512, AES-256-GCM
Expand Down
1 change: 1 addition & 0 deletions tests/test_pairwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
hpke.Suite__DHKEM_P256_HKDF_SHA256__HKDF_SHA256__AES_128_GCM,
hpke.Suite__DHKEM_P256_HKDF_SHA256__HKDF_SHA256__AES_256_GCM,
hpke.Suite__DHKEM_P256_HKDF_SHA256__HKDF_SHA512__AES_128_GCM,
hpke.Suite__DHKEM_P384_HKDF_SHA384__HKDF_SHA384__AES_256_GCM,
hpke.Suite__DHKEM_P521_HKDF_SHA512__HKDF_SHA512__AES_256_GCM,
hpke.Suite__DHKEM_P256_HKDF_SHA256__HKDF_SHA256__ChaCha20Poly1305,
]
Expand Down

0 comments on commit 6ba7f45

Please sign in to comment.