use crate::ring::Ring; use crate::dft::ntt::Table; use crate::modulus::prime::Prime; use crate::modulus::montgomery::Montgomery; use crate::poly::Poly; impl Ring{ pub fn new(n:usize, q_base:u64, q_power:usize) -> Self{ let prime: Prime = Prime::::new(q_base, q_power); Self { n: n, modulus: prime.clone(), dft: Box::new(Table::::new(prime, (2 * n) as u64)), } } pub fn n(&self) -> usize{ return self.n } fn new_poly_core(&self) -> Poly where O: Default + Clone { Poly::::new(self.n()) } pub fn new_poly(&self) -> Poly{ self.new_poly_core::() } pub fn new_poly_montgomery(&self) -> Poly>{ self.new_poly_core::>() } }