Skip to content

Commit 222ccef

Browse files
author
Ahmed
committed
Add Array sizes required for NTRU-Prime
1 parent 390b3e4 commit 222ccef

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

src/sizes.rs

+32-2
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,7 @@ impl_array_sizes_with_import! {
601601
mod extra_sizes {
602602
use super::{ArraySize, AssocArraySize};
603603
use typenum::{
604-
consts::{B0, B1},
605-
UInt, UTerm,
604+
consts::{B0, B1}, UInt, UTerm, U1013, U1014, U653, U654, U761, U762, U857, U858, U953, U954
606605
};
607606

608607
// This macro constructs a UInt type from a sequence of bits. The bits are interpreted as the
@@ -805,6 +804,16 @@ mod extra_sizes {
805804
pub type U4064 = uint!(0 0 0 0 0 1 1 1 1 1 1 1);
806805
pub type U4080 = uint!(0 0 0 0 1 1 1 1 1 1 1 1);
807806

807+
//NTRU-PRIME sizes
808+
pub type U1277 = uint!(1 0 0 1 1 1 1 1 1 0 1);
809+
pub type U1278 = uint!(1 0 0 1 1 1 1 1 1 1 0);
810+
pub type U1305 = uint!(1 0 1 0 0 0 1 1 0 0 1);
811+
pub type U1521 = uint!(1 0 1 1 1 1 1 0 0 0 1);
812+
pub type U1713 = uint!(1 1 0 1 0 1 1 0 0 0 1);
813+
pub type U1905 = uint!(1 1 1 0 1 1 1 0 0 0 1);
814+
pub type U2025 = uint!(1 1 1 1 1 1 0 1 0 0 1);
815+
pub type U2552 = uint!(1 0 0 1 1 1 1 1 1 0 0 0);
816+
808817
// ML-DSA sizes
809818
pub type U2420 = uint!(0 0 1 0 1 1 1 0 1 0 0 1);
810819
pub type U3293 = uint!(1 0 1 1 1 0 1 1 0 0 1 1);
@@ -1011,6 +1020,27 @@ mod extra_sizes {
10111020
4080 => U4080,
10121021
}
10131022

1023+
// NTRU-Prime sizes
1024+
impl_array_sizes! {
1025+
653 => U653,
1026+
654 => U654,
1027+
761 => U761,
1028+
762 => U762,
1029+
857 => U857,
1030+
858 => U858,
1031+
953 => U953,
1032+
954 => U954,
1033+
1013 => U1013,
1034+
1014 => U1014,
1035+
1277 => U1277,
1036+
1278 => U1278,
1037+
1305 => U1305,
1038+
1521 => U1521,
1039+
1713 => U1713,
1040+
1905 => U1905,
1041+
2025 => U2025,
1042+
2552 => U2552,
1043+
}
10141044
// ML-DSA sizes
10151045
impl_array_sizes! {
10161046
2420 => U2420,

0 commit comments

Comments
 (0)