* fix #131

* fix #130

* update CHANGELOG.md
This commit is contained in:
Jean-Philippe Bossuat
2026-01-16 18:14:07 +01:00
committed by GitHub
parent 2cf0b1cf82
commit 2559d8ea81
7 changed files with 49 additions and 42 deletions

View File

@@ -7,7 +7,7 @@ use poulpy_hal::{
use crate::{
Distribution, GLWEEncryptSk, GetDistribution, GetDistributionMut, ScratchTakeCore,
layouts::{
GLWE, GLWEInfos, GLWEPublicKey, GLWEToMut,
GLWEInfos, GLWEPublicKey, GLWEToMut,
prepared::{GLWESecretPrepared, GLWESecretPreparedToRef},
},
};
@@ -52,10 +52,7 @@ where
// Its ok to allocate scratch space here since pk is usually generated only once.
let mut scratch: ScratchOwned<BE> = ScratchOwned::alloc(self.glwe_encrypt_sk_tmp_bytes(res));
let mut tmp: GLWE<Vec<u8>> = GLWE::alloc_from_infos(res);
tmp.encrypt_zero_sk(self, sk, source_xa, source_xe, scratch.borrow());
res.to_mut().encrypt_zero_sk(self, sk, source_xa, source_xe, scratch.borrow());
}
*res.dist_mut() = *sk.dist();
}