diff --git a/math/src/automorphism.rs b/math/src/automorphism.rs index d517ff7..6f985ff 100644 --- a/math/src/automorphism.rs +++ b/math/src/automorphism.rs @@ -1,11 +1,11 @@ use crate::modulus::WordOps; -pub struct AutomorphismPermutation { +pub struct AutoPerm { pub gal_el: usize, pub permutation: Vec, } -impl AutomorphismPermutation { +impl AutoPerm { /// Returns a lookup table for the automorphism X^{i} -> X^{i * k mod nth_root}. /// Method will panic if n or nth_root are not power-of-two. /// Method will panic if gal_el is not coprime with nth_root. diff --git a/math/src/ring/impl_u64/automorphism.rs b/math/src/ring/impl_u64/automorphism.rs index c21ade3..25579dd 100644 --- a/math/src/ring/impl_u64/automorphism.rs +++ b/math/src/ring/impl_u64/automorphism.rs @@ -1,4 +1,4 @@ -use crate::automorphism::AutomorphismPermutation; +use crate::automorphism::AutoPerm; use crate::modulus::{ScalarOperations, ONCE}; use crate::modulus::{WordOps, REDUCEMOD}; use crate::poly::Poly; @@ -118,7 +118,7 @@ impl Ring { pub fn a_apply_automorphism_from_perm_into_b( &self, a: &Poly, - auto_perm: &AutomorphismPermutation, + auto_perm: &AutoPerm, b: &mut Poly, ) { self.automorphism_from_perm_core::<0, ONCE, NTT>(a, auto_perm, b) @@ -128,7 +128,7 @@ impl Ring { pub fn a_apply_automorphism_from_perm_add_b_into_b( &self, a: &Poly, - auto_perm: &AutomorphismPermutation, + auto_perm: &AutoPerm, b: &mut Poly, ) { self.automorphism_from_perm_core::<1, REDUCE, NTT>(a, auto_perm, b) @@ -138,7 +138,7 @@ impl Ring { pub fn a_apply_automorphism_from_perm_sub_b_into_b( &self, a: &Poly, - auto_perm: &AutomorphismPermutation, + auto_perm: &AutoPerm, b: &mut Poly, ) { self.automorphism_from_perm_core::<2, REDUCE, NTT>(a, auto_perm, b) @@ -148,7 +148,7 @@ impl Ring { fn automorphism_from_perm_core( &self, a: &Poly, - auto_perm: &AutomorphismPermutation, + auto_perm: &AutoPerm, b: &mut Poly, ) { debug_assert!( diff --git a/math/tests/automorphism.rs b/math/tests/automorphism.rs index 1abd595..0adb306 100644 --- a/math/tests/automorphism.rs +++ b/math/tests/automorphism.rs @@ -1,5 +1,5 @@ use itertools::izip; -use math::automorphism::AutomorphismPermutation; +use math::automorphism::AutoPerm; use math::poly::Poly; use math::ring::Ring; @@ -79,7 +79,7 @@ fn test_automorphism_from_perm_u64(ring: &Ring, nth_root: let gal_el: usize = 2 * nth_root - 1; - let auto_perm = AutomorphismPermutation::new::(n, gal_el, nth_root); + let auto_perm = AutoPerm::new::(n, gal_el, nth_root); ring.a_apply_automorphism_from_perm_into_b::(&p0, &auto_perm, &mut p1);