fix lattice

This commit is contained in:
Sam Hadow 2025-04-02 18:09:42 +02:00
parent 7bc9d1f735
commit 3e07dac628

View File

@ -34,7 +34,7 @@ impl Matrix {
// -x0 on diagonal, 0 everywhere else
let x0 = &ciphertexts[0];
for i in 0..n - 1 {
for i in 1..n {
let mut row = vec![int!(0); n];
row[i] = -x0.clone();
values.extend(row);
@ -92,12 +92,12 @@ mod tests {
int!(4),
int!(8),
int!(12),
int!(0),
int!(-5),
int!(0),
int!(0),
int!(0),
int!(-5),
int!(0),
];
let lattice = Matrix::new_lattice(noise_bits, ciphertexts).unwrap();