add zero_byte for fhe_uint & fix test for glwe blind selection

This commit is contained in:
Pro7ech
2025-11-05 09:46:00 +01:00
parent 6cf571c0b0
commit 92cfef5b60
3 changed files with 33 additions and 14 deletions

View File

@@ -58,7 +58,7 @@ where
}
pub fn sext(x: u32, byte: usize) -> u32 {
x | ((x >> (byte << 3)) & 1) * (0xFFFF_FFFF & (0xFFFF_FFFF << (byte << 3)))
x | (((x >> (byte << 3)) & 1) * (0xFFFF_FFFF << (byte << 3)))
}
pub fn test_fhe_uint_splice_u8<BRA: BlindRotationAlgo, BE: Backend>(test_context: &TestContext<BRA, BE>)

View File

@@ -129,7 +129,7 @@ where
res.decrypt(module, &mut pt, sk_glwe_prep, scratch.borrow());
let idx = ((k >> bit_start) & mask) as usize;
if idx.is_multiple_of(3) {
if !idx.is_multiple_of(3) {
assert_eq!(0, pt.decode_coeff_i64(TorusPrecision(base2k.as_u32()), 0));
} else {
assert_eq!(