Skip to content

Commit 70189c0

Browse files
authored
Expand array sizes through U1024 (#46)
Post-quantum schemes like Kyber/Saber require sizes larger than what is currently supported. This extends the allowed array sizes through U1024 in multiples of 16, although that still won't be enough to cover all cases. However, it's the current limit of what `typenum` provides convenient type aliases for.
1 parent b362ec7 commit 70189c0

File tree

1 file changed

+39
-6
lines changed

1 file changed

+39
-6
lines changed

src/sizes.rs

+39-6
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ use super::{ArraySize, AssocArraySize};
55
macro_rules! impl_array_size {
66
($($len:expr => $ty:ident),+) => {
77
$(
8-
unsafe impl ArraySize for typenum::$ty {
8+
unsafe impl ArraySize for typenum::consts::$ty {
99
type ArrayType<T> = [T; $len];
1010
}
1111

1212
impl<T> AssocArraySize for [T; $len] {
13-
type Size = typenum::$ty;
13+
type Size = typenum::consts::$ty;
1414
}
1515
)+
1616
};
@@ -280,13 +280,46 @@ impl_array_size! {
280280
320 => U320,
281281
336 => U336,
282282
352 => U352,
283+
368 => U368,
283284
384 => U384,
285+
400 => U400,
286+
416 => U416,
287+
432 => U432,
284288
448 => U448,
289+
464 => U464,
290+
480 => U480,
291+
496 => U496,
285292
512 => U512,
293+
528 => U528,
294+
544 => U544,
295+
560 => U560,
296+
576 => U576,
297+
592 => U592,
298+
608 => U608,
299+
624 => U624,
300+
640 => U640,
301+
656 => U656,
302+
672 => U672,
303+
688 => U688,
304+
704 => U704,
305+
720 => U720,
306+
736 => U736,
307+
752 => U752,
286308
768 => U768,
309+
784 => U784,
310+
800 => U800,
311+
816 => U816,
312+
832 => U832,
313+
848 => U848,
314+
864 => U864,
315+
880 => U880,
287316
896 => U896,
288-
1024 => U1024,
289-
2048 => U2048,
290-
4096 => U4096,
291-
8192 => U8192
317+
912 => U912,
318+
928 => U928,
319+
944 => U944,
320+
960 => U960,
321+
976 => U976,
322+
992 => U992,
323+
1008 => U1008,
324+
1024 => U1024
292325
}

0 commit comments

Comments
 (0)