use anyhow::Result;
use poulpy_core::layouts::{
GGLWEInfos, GGLWEPreparedToBackendRef, GLWEAutomorphismKeyHelper, GLWEToBackendMut, GLWEToBackendRef, GetGaloisElement,
prepared::GLWEAutomorphismKeyPreparedToBackendRef,
};
use poulpy_hal::layouts::{Backend, ScratchArena};
use crate::{CKKSCtBounds, SetCKKSInfos};
pub trait CKKSRotateOps<BE: Backend> {
fn ckks_rotate_tmp_bytes<C, K>(&self, ct_infos: &C, key_infos: &K) -> usize
where
C: CKKSCtBounds,
K: GGLWEInfos;
fn ckks_rotate_into<Dst, Src, H, K>(
&self,
dst: &mut Dst,
src: &Src,
k: i64,
keys: &H,
scratch: &mut ScratchArena<'_, BE>,
) -> Result<()>
where
K: GLWEAutomorphismKeyPreparedToBackendRef<BE> + GGLWEPreparedToBackendRef<BE> + GetGaloisElement + GGLWEInfos,
H: GLWEAutomorphismKeyHelper<K, BE>,
Dst: GLWEToBackendMut<BE> + CKKSCtBounds + SetCKKSInfos,
Src: GLWEToBackendRef<BE> + CKKSCtBounds;
fn ckks_rotate_assign<Dst, H, K>(&self, dst: &mut Dst, k: i64, keys: &H, scratch: &mut ScratchArena<'_, BE>) -> Result<()>
where
K: GLWEAutomorphismKeyPreparedToBackendRef<BE> + GGLWEPreparedToBackendRef<BE> + GetGaloisElement + GGLWEInfos,
H: GLWEAutomorphismKeyHelper<K, BE>,
Dst: GLWEToBackendMut<BE> + CKKSCtBounds + SetCKKSInfos;
}