Commit 5aef4fcd authored by Martin Thomson's avatar Martin Thomson

Bug 1699021 - Add AES-256-GCM to HPKE, r=bbeurdouche

Differential Revision: https://phabricator.services.mozilla.com/D108734

--HG--
extra : rebase_source : ffa43f8cd1f341d56e8782f81a2aa24243533614
parent b1b15770
......@@ -20,11 +20,11 @@ for tc in json.load(sys.stdin):
# X25519
if tc["kem_id"] != 32:
continue
# SHA-2 256, 384, and 512
if tc["kdf_id"] != 1 and tc["kdf_id"] != 2 and tc["kdf_id"] != 3:
# SHA-2 256, 384, and 512 (1..3)
if not tc["kdf_id"] in [1, 2, 3]:
continue
# AES-128-GCM and ChaCha20Poly1305
if tc["aead_id"] != 1 and tc["aead_id"] != 3:
# AES-128-GCM, AES-256-GCM, and ChaCha20Poly1305 (1..3 also)
if not tc["aead_id"] in [1, 2, 3]:
continue
print(f"{{{i},")
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -65,6 +65,7 @@ static const hpkeKdfParams kdfParams[] = {
static const hpkeAeadParams aeadParams[] = {
/* AEAD, Nk, Nn, tagLen, mechanism */
{ HpkeAeadAes128Gcm, 16, 12, 16, CKM_AES_GCM },
{ HpkeAeadAes256Gcm, 32, 12, 16, CKM_AES_GCM },
{ HpkeAeadChaCha20Poly1305, 32, 12, 16, CKM_CHACHA20_POLY1305 },
};
......@@ -100,8 +101,10 @@ aeadId2Params(HpkeAeadId aeadId)
switch (aeadId) {
case HpkeAeadAes128Gcm:
return &aeadParams[0];
case HpkeAeadChaCha20Poly1305:
case HpkeAeadAes256Gcm:
return &aeadParams[1];
case HpkeAeadChaCha20Poly1305:
return &aeadParams[2];
default:
return NULL;
}
......
......@@ -37,7 +37,7 @@ typedef enum {
HpkeModePsk = 1,
} HpkeModeId;
/* https://tools.ietf.org/html/draft-irtf-cfrg-hpke-07#section-7.1 */
/* https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hpke-08#section-7.1 */
typedef enum {
HpkeDhKemX25519Sha256 = 0x20,
} HpkeKemId;
......@@ -50,6 +50,7 @@ typedef enum {
typedef enum {
HpkeAeadAes128Gcm = 1,
HpkeAeadAes256Gcm = 2,
HpkeAeadChaCha20Poly1305 = 3,
} HpkeAeadId;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment