use crate::hal::{ api::{ ScalarZnxAlloc, ScalarZnxAllocBytes, ScalarZnxAutomorphism, ScalarZnxAutomorphismInplace, ScalarZnxFromBytes, ScalarZnxMulXpMinusOne, ScalarZnxMulXpMinusOneInplace, }, layouts::{Backend, Module, ScalarZnxOwned, ScalarZnxToMut, ScalarZnxToRef}, oep::{ ScalarZnxAllocBytesImpl, ScalarZnxAllocImpl, ScalarZnxAutomorphismImpl, ScalarZnxAutomorphismInplaceIml, ScalarZnxFromBytesImpl, ScalarZnxMulXpMinusOneImpl, ScalarZnxMulXpMinusOneInplaceImpl, }, }; impl ScalarZnxAllocBytes for Module where B: Backend + ScalarZnxAllocBytesImpl, { fn scalar_znx_alloc_bytes(&self, cols: usize) -> usize { B::scalar_znx_alloc_bytes_impl(self.n(), cols) } } impl ScalarZnxAlloc for Module where B: Backend + ScalarZnxAllocImpl, { fn scalar_znx_alloc(&self, cols: usize) -> ScalarZnxOwned { B::scalar_znx_alloc_impl(self.n(), cols) } } impl ScalarZnxFromBytes for Module where B: Backend + ScalarZnxFromBytesImpl, { fn scalar_znx_from_bytes(&self, cols: usize, bytes: Vec) -> ScalarZnxOwned { B::scalar_znx_from_bytes_impl(self.n(), cols, bytes) } } impl ScalarZnxAutomorphism for Module where B: Backend + ScalarZnxAutomorphismImpl, { fn scalar_znx_automorphism(&self, k: i64, res: &mut R, res_col: usize, a: &A, a_col: usize) where R: ScalarZnxToMut, A: ScalarZnxToRef, { B::scalar_znx_automorphism_impl(self, k, res, res_col, a, a_col); } } impl ScalarZnxAutomorphismInplace for Module where B: Backend + ScalarZnxAutomorphismInplaceIml, { fn scalar_znx_automorphism_inplace(&self, k: i64, a: &mut A, a_col: usize) where A: ScalarZnxToMut, { B::scalar_znx_automorphism_inplace_impl(self, k, a, a_col); } } impl ScalarZnxMulXpMinusOne for Module where B: Backend + ScalarZnxMulXpMinusOneImpl, { fn scalar_znx_mul_xp_minus_one(&self, p: i64, r: &mut R, r_col: usize, a: &A, a_col: usize) where R: ScalarZnxToMut, A: ScalarZnxToRef, { B::scalar_znx_mul_xp_minus_one_impl(self, p, r, r_col, a, a_col); } } impl ScalarZnxMulXpMinusOneInplace for Module where B: Backend + ScalarZnxMulXpMinusOneInplaceImpl, { fn scalar_znx_mul_xp_minus_one_inplace(&self, p: i64, r: &mut R, r_col: usize) where R: ScalarZnxToMut, { B::scalar_znx_mul_xp_minus_one_inplace_impl(self, p, r, r_col); } }