Add bddkey encrypt sk tmp_bytes

This commit is contained in:
Pro7ech
2025-11-14 16:47:14 +01:00
parent efdadb9592
commit 1ad54f53a8

View File

@@ -68,6 +68,10 @@ where
} }
pub trait BDDKeyEncryptSk<BRA: BlindRotationAlgo, BE: Backend> { pub trait BDDKeyEncryptSk<BRA: BlindRotationAlgo, BE: Backend> {
fn bdd_key_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize
where
A: BDDKeyInfos;
fn bdd_key_encrypt_sk<D, S0, S1>( fn bdd_key_encrypt_sk<D, S0, S1>(
&self, &self,
res: &mut BDDKey<D, BRA>, res: &mut BDDKey<D, BRA>,
@@ -87,6 +91,14 @@ where
Self: CircuitBootstrappingKeyEncryptSk<BRA, BE> + GLWEToLWESwitchingKeyEncryptSk<BE>, Self: CircuitBootstrappingKeyEncryptSk<BRA, BE> + GLWEToLWESwitchingKeyEncryptSk<BE>,
Scratch<BE>: ScratchTakeCore<BE>, Scratch<BE>: ScratchTakeCore<BE>,
{ {
fn bdd_key_encrypt_sk_tmp_bytes<A>(&self, infos: &A) -> usize
where
A: BDDKeyInfos,
{
self.circuit_bootstrapping_key_encrypt_sk_tmp_bytes(&infos.cbt_infos())
.max(self.glwe_to_lwe_key_encrypt_sk_tmp_bytes(&infos.ks_infos()))
}
fn bdd_key_encrypt_sk<D, S0, S1>( fn bdd_key_encrypt_sk<D, S0, S1>(
&self, &self,
res: &mut BDDKey<D, BRA>, res: &mut BDDKey<D, BRA>,