Skip to content

Commit cb2b5f8

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

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

src/sizes.rs

+25-1
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ mod extra_sizes {
602602
use super::{ArraySize, AssocArraySize};
603603
use typenum::{
604604
consts::{B0, B1},
605-
UInt, UTerm,
605+
UInt, UTerm, U1013, U653, U761, U857, U953,
606606
};
607607

608608
// This macro constructs a UInt type from a sequence of bits. The bits are interpreted as the
@@ -805,6 +805,15 @@ mod extra_sizes {
805805
pub type U4064 = uint!(0 0 0 0 0 1 1 1 1 1 1 1);
806806
pub type U4080 = uint!(0 0 0 0 1 1 1 1 1 1 1 1);
807807

808+
//NTRU-PRIME sizes
809+
pub type U1277 = uint!(1 0 0 1 1 1 1 1 1 0 1);
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,21 @@ mod extra_sizes {
10111020
4080 => U4080,
10121021
}
10131022

1023+
// NTRU-Prime sizes
1024+
impl_array_sizes! {
1025+
653 => U653,
1026+
761 => U761,
1027+
857 => U857,
1028+
953 => U953,
1029+
1013 => U1013,
1030+
1277 => U1277,
1031+
1305 => U1305,
1032+
1521 => U1521,
1033+
1713 => U1713,
1034+
1905 => U1905,
1035+
2025 => U2025,
1036+
2552 => U2552,
1037+
}
10141038
// ML-DSA sizes
10151039
impl_array_sizes! {
10161040
2420 => U2420,

0 commit comments

Comments
 (0)