fix cross-base2k vec_znx_normalize wrong early carry

This commit is contained in:
Pro7ech
2025-11-17 16:45:50 +01:00
parent 2613bf1450
commit 08d3f55af9
13 changed files with 101 additions and 115 deletions

View File

@@ -49,8 +49,6 @@ where
a_enc.sext(module, j, keys, scratch.borrow());
// println!("{:08x} -> {:08x} {:08x}", a, sext(a, j), a_enc.decrypt(module, sk, scratch.borrow()));
assert_eq!(
sext(a, ((1 + j as u32) << 3) - 1),
a_enc.decrypt(module, sk, scratch.borrow())
@@ -70,8 +68,6 @@ where
a_enc.sext(module, j, keys, scratch.borrow());
// println!("{:08x} -> {:08x} {:08x}", a, sext(a, j), a_enc.decrypt(module, sk, scratch.borrow()));
assert_eq!(
sext(a, ((1 + j as u32) << 3) - 1),
a_enc.decrypt(module, sk, scratch.borrow())

View File

@@ -76,8 +76,6 @@ where
let k: u32 = source.next_u32();
// println!("k: {k}");
let mut k_enc_prep: FheUintPrepared<Vec<u8>, u32, BE> =
FheUintPrepared::<Vec<u8>, u32, BE>::alloc_from_infos(module, &ggsw_k_infos);
k_enc_prep.encrypt_sk(

View File

@@ -328,12 +328,6 @@ pub fn circuit_bootstrap_core<R, L, D, M, BRA: BlindRotationAlgo, BE: Backend>(
tmp_glwe.trace(module, 0, &res_glwe, &key.atk, scratch_2);
}
// let sk_glwe: &poulpy_core::layouts::GLWESecret<&[u8]> = &sk_glwe.to_ref();
// let sk_glwe_prepared: GLWESecretPrepared<Vec<u8>, BE> = GLWESecretPrepared::alloc(module, sk_glwe.rank());
// let mut pt: GLWEPlaintext<Vec<u8>> = GLWEPlaintext::alloc_from_infos(&res_glwe);
// res_glwe.decrypt(module, &mut pt, &sk_glwe_prepared, scratch_2);
// println!("pt[{i}]: {}", pt);
if i < dnum {
module.glwe_rotate_inplace(-(gap as i64), &mut res_glwe, scratch_2);
}