Tighten a too-permissive debug_assert in NafLookupTable8.

This issue was found by Laurent Grémy & Nicolas Surbayrole of Quarkslab.
This commit is contained in:
Henry de Valence 2019-08-06 15:17:34 -07:00
parent 90baabe50b
commit a480844992

View file

@ -171,7 +171,7 @@ pub(crate) struct NafLookupTable8<T>(pub(crate) [T; 64]);
impl<T: Copy> NafLookupTable8<T> {
pub fn select(&self, x: usize) -> T {
debug_assert_eq!(x & 1, 1);
debug_assert!(x < 256);
debug_assert!(x < 128);
self.0[x / 2]
}