#![allow(clippy::too_many_arguments)]
use poulpy_hal::layouts::{Backend, ScratchArena};
use crate::layouts::{
GGLWEInfos, GLWEInfos, GLWEToBackendMut, GLWEToBackendRef, GetAutomorphismKey, LWEInfos, LinearTransformation,
prepared::{LinearTransformationBabySteps, PreparedDiagonal},
};
pub trait GLWELinearTransformations<BE: Backend> {
fn glwe_eval_linear_transformation_tmp_bytes<R, A, B, K>(&self, res: &R, a: &A, pt: &B, key: &K) -> usize
where
R: GLWEInfos,
A: GLWEInfos,
B: GLWEInfos,
K: GGLWEInfos;
fn glwe_eval_linear_transformation_unprepared_rhs_tmp_bytes<R, A, B, K>(&self, res: &R, a: &A, pt: &B, key: &K) -> usize
where
R: GLWEInfos,
A: GLWEInfos,
B: GLWEInfos,
K: GGLWEInfos;
fn glwe_prepare_linear_transformation_baby_steps_tmp_bytes<A, K>(&self, a: &A, key: &K) -> usize
where
A: GLWEInfos,
K: GGLWEInfos;
fn glwe_prepare_linear_transformation_rhs_tmp_bytes<P>(&self, pt_infos: &P) -> usize
where
P: LWEInfos;
fn glwe_prepare_linear_transformation_rhs<P>(
&self,
prepared: &mut LinearTransformation<PreparedDiagonal<BE::OwnedBuf, BE>>,
lt: &LinearTransformation<P>,
scratch: &mut ScratchArena<'_, BE>,
) where
P: GLWEToBackendRef<BE> + GLWEInfos;
fn glwe_prepare_linear_transformation_baby_steps<A, H>(
&self,
cache: &mut LinearTransformationBabySteps<BE>,
a: &A,
keys: &H,
scratch: &mut ScratchArena<'_, BE>,
) where
A: GLWEToBackendRef<BE> + GLWEInfos,
H: GetAutomorphismKey<BE>;
fn glwe_eval_linear_transformation_into<R, P, H>(
&self,
cnv_offset: usize,
res: &mut R,
lhs: &LinearTransformationBabySteps<BE>,
rhs: &LinearTransformation<P>,
keys: &H,
scratch: &mut ScratchArena<'_, BE>,
) where
R: GLWEToBackendMut<BE> + GLWEInfos,
P: crate::default::linear_transformation::DiagonalProd<BE>,
H: GetAutomorphismKey<BE>;
}