fixed overflow

This commit is contained in:
Jean-Philippe Bossuat
2025-01-16 17:59:01 +01:00
parent 556346d623
commit 3b7d889971
3 changed files with 18 additions and 4 deletions

View File

@@ -18,7 +18,12 @@ impl AutoPermMap {
gal_el
}
pub fn gen<O: Unsigned, const NTT: bool>(&mut self, ring: &Ring<O>, gen_1: usize, gen_2: bool) -> usize {
pub fn gen<O: Unsigned, const NTT: bool>(
&mut self,
ring: &Ring<O>,
gen_1: usize,
gen_2: bool,
) -> usize {
self.insert(AutoPerm::new::<O, NTT>(ring, gen_1, gen_2))
}
@@ -27,7 +32,9 @@ impl AutoPermMap {
}
}
#[derive(Debug)]
pub struct AutoPerm {
pub ntt: bool,
pub gal_el: usize,
pub permutation: Vec<usize>,
}
@@ -64,6 +71,7 @@ impl AutoPerm {
}
Self {
ntt: NTT,
gal_el: gal_el,
permutation: permutation,
}