This commit is contained in:
Jean-Philippe Bossuat
2026-01-17 07:47:54 +01:00
committed by GitHub
parent 2559d8ea81
commit f679f6874d
3 changed files with 71 additions and 21 deletions

View File

@@ -7,7 +7,8 @@ use crate::{
dist::Distribution,
layouts::{
Degree, GGLWE, GGLWEInfos, GGLWELayout, GGSW, GGSWInfos, GLWE, GLWEAutomorphismKey, GLWEInfos, GLWEPlaintext,
GLWEPrepared, GLWEPublicKey, GLWESecret, GLWESecretTensor, GLWESwitchingKey, GLWETensorKey, LWE, LWEInfos, Rank,
GLWEPrepared, GLWEPublicKey, GLWESecret, GLWESecretTensor, GLWESwitchingKey, GLWETensorKey, LWE, LWEInfos, LWEPlaintext,
Rank,
prepared::{
GGLWEPrepared, GGSWPrepared, GLWEAutomorphismKeyPrepared, GLWEPublicKeyPrepared, GLWESecretPrepared,
GLWESwitchingKeyPrepared, GLWETensorKeyPrepared,
@@ -34,6 +35,21 @@ where
)
}
fn take_lwe_plaintext<A>(&mut self, infos: &A) -> (LWEPlaintext<&mut [u8]>, &mut Self)
where
A: LWEInfos,
{
let (data, scratch) = self.take_vec_znx(1, 1, infos.size());
(
LWEPlaintext {
k: infos.k(),
base2k: infos.base2k(),
data,
},
scratch,
)
}
fn take_glwe<A>(&mut self, infos: &A) -> (GLWE<&mut [u8]>, &mut Self)
where
A: GLWEInfos,