Bug fixes

- fixed `encoding.rs/decode_coeff_i64` for the case `k < basek2`
- `glwe/external_product.rs/external_product_scratch_space` did not allocate enough space for [`a_dft`](829b8be610/core/src/glwe/external_product.rs (L83)) when `k_out < k_ggsw`. Fixed by replacing `in_size` with `ggsw_size`.
- `glwe/ops.rs/add` sets `basek` and `k`of `self` GLWECiphertext whic is invalid because the `size` which depends on `inner` data remains unchanged.
- (not a fix) expose `backend` from `core`.
This commit is contained in:
Janmajaya Mall
2025-07-06 12:40:08 +05:30
parent 2a5e0e7dc3
commit 463731948d
4 changed files with 10 additions and 8 deletions

View File

@@ -14,6 +14,7 @@ pub trait GLWEOps: GLWECiphertextToMut + Infos + SetMetaData {
assert_eq!(b.n(), module.n());
assert_eq!(self.n(), module.n());
assert_eq!(a.basek(), b.basek());
assert_eq!(self.basek(), a.basek());
assert!(self.rank() >= a.rank().max(b.rank()));
}
@@ -46,8 +47,8 @@ pub trait GLWEOps: GLWECiphertextToMut + Infos + SetMetaData {
});
});
self.set_basek(a.basek());
self.set_k(a.k().max(b.k()));
// self.set_basek(a.basek());
// self.set_k(a.k().max(b.k()));
}
fn add_inplace<A>(&mut self, module: &Module<FFT64>, a: &A)