use crate::{ api::{ VecZnxBigAdd, VecZnxBigAddInplace, VecZnxBigAddNormal, VecZnxBigAddSmall, VecZnxBigAddSmallInplace, VecZnxBigAlloc, VecZnxBigAutomorphism, VecZnxBigAutomorphismInplace, VecZnxBigAutomorphismInplaceTmpBytes, VecZnxBigBytesOf, VecZnxBigFromBytes, VecZnxBigFromSmall, VecZnxBigNegate, VecZnxBigNegateInplace, VecZnxBigNormalize, VecZnxBigNormalizeTmpBytes, VecZnxBigSub, VecZnxBigSubInplace, VecZnxBigSubNegateInplace, VecZnxBigSubSmallA, VecZnxBigSubSmallB, VecZnxBigSubSmallInplace, VecZnxBigSubSmallNegateInplace, }, layouts::{Backend, Module, Scratch, VecZnxBigOwned, VecZnxBigToMut, VecZnxBigToRef, VecZnxToMut, VecZnxToRef}, oep::{ VecZnxBigAddImpl, VecZnxBigAddInplaceImpl, VecZnxBigAddNormalImpl, VecZnxBigAddSmallImpl, VecZnxBigAddSmallInplaceImpl, VecZnxBigAllocBytesImpl, VecZnxBigAllocImpl, VecZnxBigAutomorphismImpl, VecZnxBigAutomorphismInplaceImpl, VecZnxBigAutomorphismInplaceTmpBytesImpl, VecZnxBigFromBytesImpl, VecZnxBigFromSmallImpl, VecZnxBigNegateImpl, VecZnxBigNegateInplaceImpl, VecZnxBigNormalizeImpl, VecZnxBigNormalizeTmpBytesImpl, VecZnxBigSubImpl, VecZnxBigSubInplaceImpl, VecZnxBigSubNegateInplaceImpl, VecZnxBigSubSmallAImpl, VecZnxBigSubSmallBImpl, VecZnxBigSubSmallInplaceImpl, VecZnxBigSubSmallNegateInplaceImpl, }, source::Source, }; impl VecZnxBigFromSmall for Module where B: Backend + VecZnxBigFromSmallImpl, { fn vec_znx_big_from_small(&self, res: &mut R, res_col: usize, a: &A, a_col: usize) where R: VecZnxBigToMut, A: VecZnxToRef, { B::vec_znx_big_from_small_impl(res, res_col, a, a_col); } } impl VecZnxBigAlloc for Module where B: Backend + VecZnxBigAllocImpl, { fn vec_znx_big_alloc(&self, cols: usize, size: usize) -> VecZnxBigOwned { B::vec_znx_big_alloc_impl(self.n(), cols, size) } } impl VecZnxBigFromBytes for Module where B: Backend + VecZnxBigFromBytesImpl, { fn vec_znx_big_from_bytes(&self, cols: usize, size: usize, bytes: Vec) -> VecZnxBigOwned { B::vec_znx_big_from_bytes_impl(self.n(), cols, size, bytes) } } impl VecZnxBigBytesOf for Module where B: Backend + VecZnxBigAllocBytesImpl, { fn bytes_of_vec_znx_big(&self, cols: usize, size: usize) -> usize { B::vec_znx_big_bytes_of_impl(self.n(), cols, size) } } impl VecZnxBigAddNormal for Module where B: Backend + VecZnxBigAddNormalImpl, { fn vec_znx_big_add_normal>( &self, base2k: usize, res: &mut R, res_col: usize, k: usize, source: &mut Source, sigma: f64, bound: f64, ) { B::add_normal_impl(self, base2k, res, res_col, k, source, sigma, bound); } } impl VecZnxBigAdd for Module where B: Backend + VecZnxBigAddImpl, { fn vec_znx_big_add(&self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &C, b_col: usize) where R: VecZnxBigToMut, A: VecZnxBigToRef, C: VecZnxBigToRef, { B::vec_znx_big_add_impl(self, res, res_col, a, a_col, b, b_col); } } impl VecZnxBigAddInplace for Module where B: Backend + VecZnxBigAddInplaceImpl, { fn vec_znx_big_add_inplace(&self, res: &mut R, res_col: usize, a: &A, a_col: usize) where R: VecZnxBigToMut, A: VecZnxBigToRef, { B::vec_znx_big_add_inplace_impl(self, res, res_col, a, a_col); } } impl VecZnxBigAddSmall for Module where B: Backend + VecZnxBigAddSmallImpl, { fn vec_znx_big_add_small(&self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &C, b_col: usize) where R: VecZnxBigToMut, A: VecZnxBigToRef, C: VecZnxToRef, { B::vec_znx_big_add_small_impl(self, res, res_col, a, a_col, b, b_col); } } impl VecZnxBigAddSmallInplace for Module where B: Backend + VecZnxBigAddSmallInplaceImpl, { fn vec_znx_big_add_small_inplace(&self, res: &mut R, res_col: usize, a: &A, a_col: usize) where R: VecZnxBigToMut, A: VecZnxToRef, { B::vec_znx_big_add_small_inplace_impl(self, res, res_col, a, a_col); } } impl VecZnxBigSub for Module where B: Backend + VecZnxBigSubImpl, { fn vec_znx_big_sub(&self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &C, b_col: usize) where R: VecZnxBigToMut, A: VecZnxBigToRef, C: VecZnxBigToRef, { B::vec_znx_big_sub_impl(self, res, res_col, a, a_col, b, b_col); } } impl VecZnxBigSubInplace for Module where B: Backend + VecZnxBigSubInplaceImpl, { fn vec_znx_big_sub_inplace(&self, res: &mut R, res_col: usize, a: &A, a_col: usize) where R: VecZnxBigToMut, A: VecZnxBigToRef, { B::vec_znx_big_sub_inplace_impl(self, res, res_col, a, a_col); } } impl VecZnxBigSubNegateInplace for Module where B: Backend + VecZnxBigSubNegateInplaceImpl, { fn vec_znx_big_sub_negate_inplace(&self, res: &mut R, res_col: usize, a: &A, a_col: usize) where R: VecZnxBigToMut, A: VecZnxBigToRef, { B::vec_znx_big_sub_negate_inplace_impl(self, res, res_col, a, a_col); } } impl VecZnxBigSubSmallA for Module where B: Backend + VecZnxBigSubSmallAImpl, { fn vec_znx_big_sub_small_a(&self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &C, b_col: usize) where R: VecZnxBigToMut, A: VecZnxToRef, C: VecZnxBigToRef, { B::vec_znx_big_sub_small_a_impl(self, res, res_col, a, a_col, b, b_col); } } impl VecZnxBigSubSmallInplace for Module where B: Backend + VecZnxBigSubSmallInplaceImpl, { fn vec_znx_big_sub_small_inplace(&self, res: &mut R, res_col: usize, a: &A, a_col: usize) where R: VecZnxBigToMut, A: VecZnxToRef, { B::vec_znx_big_sub_small_inplace_impl(self, res, res_col, a, a_col); } } impl VecZnxBigSubSmallB for Module where B: Backend + VecZnxBigSubSmallBImpl, { fn vec_znx_big_sub_small_b(&self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &C, b_col: usize) where R: VecZnxBigToMut, A: VecZnxBigToRef, C: VecZnxToRef, { B::vec_znx_big_sub_small_b_impl(self, res, res_col, a, a_col, b, b_col); } } impl VecZnxBigSubSmallNegateInplace for Module where B: Backend + VecZnxBigSubSmallNegateInplaceImpl, { fn vec_znx_big_sub_small_negate_inplace(&self, res: &mut R, res_col: usize, a: &A, a_col: usize) where R: VecZnxBigToMut, A: VecZnxToRef, { B::vec_znx_big_sub_small_negate_inplace_impl(self, res, res_col, a, a_col); } } impl VecZnxBigNegate for Module where B: Backend + VecZnxBigNegateImpl, { fn vec_znx_big_negate(&self, res: &mut R, res_col: usize, a: &A, a_col: usize) where R: VecZnxBigToMut, A: VecZnxBigToRef, { B::vec_znx_big_negate_impl(self, res, res_col, a, a_col); } } impl VecZnxBigNegateInplace for Module where B: Backend + VecZnxBigNegateInplaceImpl, { fn vec_znx_big_negate_inplace(&self, a: &mut A, a_col: usize) where A: VecZnxBigToMut, { B::vec_znx_big_negate_inplace_impl(self, a, a_col); } } impl VecZnxBigNormalizeTmpBytes for Module where B: Backend + VecZnxBigNormalizeTmpBytesImpl, { fn vec_znx_big_normalize_tmp_bytes(&self) -> usize { B::vec_znx_big_normalize_tmp_bytes_impl(self) } } impl VecZnxBigNormalize for Module where B: Backend + VecZnxBigNormalizeImpl, { fn vec_znx_big_normalize( &self, res_basek: usize, res: &mut R, res_col: usize, a_basek: usize, a: &A, a_col: usize, scratch: &mut Scratch, ) where R: VecZnxToMut, A: VecZnxBigToRef, { B::vec_znx_big_normalize_impl(self, res_basek, res, res_col, a_basek, a, a_col, scratch); } } impl VecZnxBigAutomorphism for Module where B: Backend + VecZnxBigAutomorphismImpl, { fn vec_znx_big_automorphism(&self, k: i64, res: &mut R, res_col: usize, a: &A, a_col: usize) where R: VecZnxBigToMut, A: VecZnxBigToRef, { B::vec_znx_big_automorphism_impl(self, k, res, res_col, a, a_col); } } impl VecZnxBigAutomorphismInplaceTmpBytes for Module where B: Backend + VecZnxBigAutomorphismInplaceTmpBytesImpl, { fn vec_znx_big_automorphism_inplace_tmp_bytes(&self) -> usize { B::vec_znx_big_automorphism_inplace_tmp_bytes_impl(self) } } impl VecZnxBigAutomorphismInplace for Module where B: Backend + VecZnxBigAutomorphismInplaceImpl, { fn vec_znx_big_automorphism_inplace(&self, k: i64, a: &mut A, a_col: usize, scratch: &mut Scratch) where A: VecZnxBigToMut, { B::vec_znx_big_automorphism_inplace_impl(self, k, a, a_col, scratch); } }