compiling CBT but failing tests

This commit is contained in:
Pro7ech
2025-10-22 10:00:32 +02:00
parent 0926913001
commit 706ecf3d07
50 changed files with 967 additions and 1060 deletions

View File

@@ -8,7 +8,7 @@ use crate::{
automorphism::glwe_ct::GLWEAutomorphism,
layouts::{
GGLWEInfos, GGLWEPreparedToRef, GGSW, GGSWInfos, GGSWToMut, GGSWToRef, GetGaloisElement,
prepared::{TensorKeyPrepared, TensorKeyPreparedToRef},
prepared::{GLWETensorKeyPrepared, GLWETensorKeyPreparedToRef},
},
};
@@ -36,7 +36,7 @@ impl<D: DataMut> GGSW<D> {
where
A: GGSWToRef,
K: GetGaloisElement + GGLWEPreparedToRef<BE> + GGLWEInfos,
T: TensorKeyPreparedToRef<BE>,
T: GLWETensorKeyPreparedToRef<BE>,
Scratch<BE>: ScratchTakeCore<BE>,
M: GGSWAutomorphism<BE>,
{
@@ -46,7 +46,7 @@ impl<D: DataMut> GGSW<D> {
pub fn automorphism_inplace<K, T, M, BE: Backend>(&mut self, module: &M, key: &K, tsk: &T, scratch: &mut Scratch<BE>)
where
K: GetGaloisElement + GGLWEPreparedToRef<BE> + GGLWEInfos,
T: TensorKeyPreparedToRef<BE>,
T: GLWETensorKeyPreparedToRef<BE>,
Scratch<BE>: ScratchTakeCore<BE>,
M: GGSWAutomorphism<BE>,
{
@@ -79,12 +79,12 @@ where
R: GGSWToMut,
A: GGSWToRef,
K: GetGaloisElement + GGLWEPreparedToRef<BE> + GGLWEInfos,
T: TensorKeyPreparedToRef<BE>,
T: GLWETensorKeyPreparedToRef<BE>,
Scratch<BE>: ScratchTakeCore<BE>,
{
let res: &mut GGSW<&mut [u8]> = &mut res.to_mut();
let a: &GGSW<&[u8]> = &a.to_ref();
let tsk: &TensorKeyPrepared<&[u8], BE> = &tsk.to_ref();
let tsk: &GLWETensorKeyPrepared<&[u8], BE> = &tsk.to_ref();
assert_eq!(res.dsize(), a.dsize());
assert!(res.dnum() <= a.dnum());
@@ -104,11 +104,11 @@ where
where
R: GGSWToMut,
K: GetGaloisElement + GGLWEPreparedToRef<BE> + GGLWEInfos,
T: TensorKeyPreparedToRef<BE>,
T: GLWETensorKeyPreparedToRef<BE>,
Scratch<BE>: ScratchTakeCore<BE>,
{
let res: &mut GGSW<&mut [u8]> = &mut res.to_mut();
let tsk: &TensorKeyPrepared<&[u8], BE> = &tsk.to_ref();
let tsk: &GLWETensorKeyPrepared<&[u8], BE> = &tsk.to_ref();
// Keyswitch the j-th row of the col 0
for row in 0..res.dnum().as_usize() {