From e87ee3949fc09b6d144c1e2465e1e3572103be83 Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Fri, 29 Nov 2024 16:31:19 -0500 Subject: [PATCH 1/2] Update ML-DSA sizes --- src/sizes.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/sizes.rs b/src/sizes.rs index cec8676..1e4f790 100644 --- a/src/sizes.rs +++ b/src/sizes.rs @@ -806,9 +806,16 @@ mod extra_sizes { pub type U4080 = uint!(0 0 0 0 1 1 1 1 1 1 1 1); // ML-DSA sizes + // + // Includes the public key, private key, and signature sizes not covered elsewhere, as well as + // some intermediate value sizes. pub type U2420 = uint!(0 0 1 0 1 1 1 0 1 0 0 1); - pub type U3293 = uint!(1 0 1 1 1 0 1 1 0 0 1 1); + pub type U3309 = uint!(1 0 1 1 0 1 1 1 0 0 1 1); + pub type U4480 = uint!(0 0 0 0 0 0 0 1 1 0 0 0 1); + pub type U4544 = uint!(0 0 0 0 0 0 1 1 1 0 0 0 1); pub type U4595 = uint!(1 1 0 0 1 1 1 1 1 0 0 0 1); + pub type U4627 = uint!(1 1 0 0 1 0 0 0 0 1 0 0 1); + pub type U4896 = uint!(0 0 0 0 0 1 0 0 1 1 0 0 1); // SLH-DSA sizes pub type U7856 = uint!(0 0 0 0 1 1 0 1 0 1 1 1 1); @@ -1050,8 +1057,12 @@ mod extra_sizes { // ML-DSA sizes impl_array_sizes! { 2420 => U2420, - 3293 => U3293, + 3309 => U3309, + 4480 => U4480, + 4544 => U4544, 4595 => U4595, + 4627 => U4627, + 4896 => U4896, } // SLH-DSA sizes From 1f71ec886895d78aadb15d73a6ff5c8815a00a56 Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Sat, 7 Dec 2024 11:15:15 -0500 Subject: [PATCH 2/2] Re-add U3293 --- src/sizes.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sizes.rs b/src/sizes.rs index 1e4f790..dc4e6e2 100644 --- a/src/sizes.rs +++ b/src/sizes.rs @@ -809,7 +809,11 @@ mod extra_sizes { // // Includes the public key, private key, and signature sizes not covered elsewhere, as well as // some intermediate value sizes. + // + // U3293 is not required for ML-DSA, but was included in an early iteration of this section + // (before the `ml_dsa` crate was created). So it is included here for backward compatibility. pub type U2420 = uint!(0 0 1 0 1 1 1 0 1 0 0 1); + pub type U3293 = uint!(1 0 1 1 1 0 1 1 0 0 1 1); pub type U3309 = uint!(1 0 1 1 0 1 1 1 0 0 1 1); pub type U4480 = uint!(0 0 0 0 0 0 0 1 1 0 0 0 1); pub type U4544 = uint!(0 0 0 0 0 0 1 1 1 0 0 0 1); @@ -1057,6 +1061,7 @@ mod extra_sizes { // ML-DSA sizes impl_array_sizes! { 2420 => U2420, + 3293 => U3293, 3309 => U3309, 4480 => U4480, 4544 => U4544,