arnaucube
arnaucube/poulpyPublic Self-hosted repository
poulpy/backend/src/hal/oep/scalar_znx.rs
backend/src/hal/oep/scalar_znx.rsRaw
 1use crate::hal::layouts::{Backend, Module, ScalarZnxOwned, ScalarZnxToMut, ScalarZnxToRef};
 2
 3pub unsafe trait ScalarZnxFromBytesImpl<B: Backend> {
 4    fn scalar_znx_from_bytes_impl(n: usize, cols: usize, bytes: Vec<u8>) -> ScalarZnxOwned;
 5}
 6
 7pub unsafe trait ScalarZnxAllocBytesImpl<B: Backend> {
 8    fn scalar_znx_alloc_bytes_impl(n: usize, cols: usize) -> usize;
 9}
10
11pub unsafe trait ScalarZnxAllocImpl<B: Backend> {
12    fn scalar_znx_alloc_impl(n: usize, cols: usize) -> ScalarZnxOwned;
13}
14
15pub unsafe trait ScalarZnxAutomorphismImpl<B: Backend> {
16    fn scalar_znx_automorphism_impl<R, A>(module: &Module<B>, k: i64, res: &mut R, res_col: usize, a: &A, a_col: usize)
17    where
18        R: ScalarZnxToMut,
19        A: ScalarZnxToRef;
20}
21
22pub unsafe trait ScalarZnxAutomorphismInplaceIml<B: Backend> {
23    fn scalar_znx_automorphism_inplace_impl<A>(module: &Module<B>, k: i64, a: &mut A, a_col: usize)
24    where
25        A: ScalarZnxToMut;
26}
27
28pub unsafe trait ScalarZnxMulXpMinusOneImpl<B: Backend> {
29    fn scalar_znx_mul_xp_minus_one_impl<R, A>(module: &Module<B>, p: i64, r: &mut R, r_col: usize, a: &A, a_col: usize)
30    where
31        R: ScalarZnxToMut,
32        A: ScalarZnxToRef;
33}
34
35pub unsafe trait ScalarZnxMulXpMinusOneInplaceImpl<B: Backend> {
36    fn scalar_znx_mul_xp_minus_one_inplace_impl<R>(module: &Module<B>, p: i64, r: &mut R, r_col: usize)
37    where
38        R: ScalarZnxToMut;
39}