Skip to content

Commit c8d0cd6

Browse files
committed
Add HPKE Hybrid KEM sizes
Implemented per <https://filippo.io/hpke-pq>, which itself derives from <https://datatracker.ietf.org/doc/html/draft-ietf-hpke-pq-03>. These sizes correspond to the encoded sizes of the encapsulating keys and ciphertexts, which are calculated as `KEM.Nek + Group.Nelem` and `KEM.Nct + Group.Nelem` respectively. The X-Wing sizes were already present due to being rounder numbers.
1 parent 15f74ea commit c8d0cd6

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/sizes.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,13 @@ mod extra_sizes {
849849
pub type U1530 = uint!(0 1 0 1 1 1 1 1 1 0 1);
850850
pub type U1658 = uint!(0 1 0 1 1 1 1 0 0 1 1);
851851

852+
// HPKE Hybrid KEM sizes
853+
// - MLKEM768-P256
854+
pub type U1153 = uint!(1 0 0 0 0 0 0 1 0 0 1);
855+
pub type U1249 = uint!(1 0 0 0 0 1 1 1 0 0 1);
856+
// - MLKEM1024-P384
857+
pub type U1665 = uint!(1 0 0 0 0 0 0 1 0 1 1);
858+
852859
// LMS sizes
853860
pub type U2047 = uint!(1 1 1 1 1 1 1 1 1 1 1);
854861
pub type U2180 = uint!(0 0 1 0 0 0 0 1 0 0 0 1);
@@ -1110,6 +1117,14 @@ mod extra_sizes {
11101117
1658 => U1658,
11111118
}
11121119

1120+
// HPKE Hybrid KEM sizes
1121+
impl_array_sizes! {
1122+
hpke_hybrid,
1123+
1153 => U1153,
1124+
1249 => U1249,
1125+
1665 => U1665,
1126+
}
1127+
11131128
// LMS sizes
11141129
impl_array_sizes! {
11151130
lms,

0 commit comments

Comments
 (0)