From c8d0cd6f3cb18f63d99b36293066d6e6a6e1ca7f Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Fri, 24 Apr 2026 07:34:45 +0000 Subject: [PATCH] Add HPKE Hybrid KEM sizes Implemented per , which itself derives from . 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. --- src/sizes.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/sizes.rs b/src/sizes.rs index d42ba6d..276afa6 100644 --- a/src/sizes.rs +++ b/src/sizes.rs @@ -849,6 +849,13 @@ mod extra_sizes { pub type U1530 = uint!(0 1 0 1 1 1 1 1 1 0 1); pub type U1658 = uint!(0 1 0 1 1 1 1 0 0 1 1); + // HPKE Hybrid KEM sizes + // - MLKEM768-P256 + pub type U1153 = uint!(1 0 0 0 0 0 0 1 0 0 1); + pub type U1249 = uint!(1 0 0 0 0 1 1 1 0 0 1); + // - MLKEM1024-P384 + pub type U1665 = uint!(1 0 0 0 0 0 0 1 0 1 1); + // LMS sizes pub type U2047 = uint!(1 1 1 1 1 1 1 1 1 1 1); pub type U2180 = uint!(0 0 1 0 0 0 0 1 0 0 0 1); @@ -1110,6 +1117,14 @@ mod extra_sizes { 1658 => U1658, } + // HPKE Hybrid KEM sizes + impl_array_sizes! { + hpke_hybrid, + 1153 => U1153, + 1249 => U1249, + 1665 => U1665, + } + // LMS sizes impl_array_sizes! { lms,