This commit is contained in:
Pro7ech
2025-10-13 12:14:11 +02:00
parent 662e533eac
commit cf377ff243
94 changed files with 1892 additions and 1235 deletions

View File

@@ -14,9 +14,9 @@ use std::marker::PhantomData;
use poulpy_core::{
Distribution,
layouts::{
GGSWCiphertext, GGSWInfos, LWESecret,
GGSW, GGSWInfos, LWESecret,
compressed::GGSWCiphertextCompressed,
prepared::{GGSWCiphertextPrepared, GLWESecretPrepared},
prepared::{GGSWPrepared, GLWESecretPrepared},
},
};
@@ -30,9 +30,9 @@ impl BlindRotationKeyAlloc for BlindRotationKey<Vec<u8>, CGGI> {
where
A: BlindRotationKeyInfos,
{
let mut data: Vec<GGSWCiphertext<Vec<u8>>> = Vec::with_capacity(infos.n_lwe().into());
let mut data: Vec<GGSW<Vec<u8>>> = Vec::with_capacity(infos.n_lwe().into());
for _ in 0..infos.n_lwe().as_usize() {
data.push(GGSWCiphertext::alloc(infos));
data.push(GGSW::alloc(infos));
}
Self {
@@ -49,7 +49,7 @@ impl BlindRotationKey<Vec<u8>, CGGI> {
A: GGSWInfos,
Module<B>: VecZnxNormalizeTmpBytes + VecZnxDftAllocBytes,
{
GGSWCiphertext::encrypt_sk_scratch_space(module, infos)
GGSW::encrypt_sk_scratch_space(module, infos)
}
}
@@ -121,8 +121,8 @@ where
where
A: BlindRotationKeyInfos,
{
let mut data: Vec<GGSWCiphertextPrepared<Vec<u8>, B>> = Vec::with_capacity(infos.n_lwe().into());
(0..infos.n_lwe().as_usize()).for_each(|_| data.push(GGSWCiphertextPrepared::alloc(module, infos)));
let mut data: Vec<GGSWPrepared<Vec<u8>, B>> = Vec::with_capacity(infos.n_lwe().into());
(0..infos.n_lwe().as_usize()).for_each(|_| data.push(GGSWPrepared::alloc(module, infos)));
Self {
data,
dist: Distribution::NONE,

View File

@@ -8,7 +8,7 @@ use std::{fmt, marker::PhantomData};
use poulpy_core::{
Distribution,
layouts::{
Base2K, Degree, Dnum, Dsize, GGSWCiphertext, GGSWInfos, GLWEInfos, LWEInfos, LWESecret, Rank, TorusPrecision,
Base2K, Degree, Dnum, Dsize, GGSW, GGSWInfos, GLWEInfos, LWEInfos, LWESecret, Rank, TorusPrecision,
prepared::GLWESecretPrepared,
},
};
@@ -98,7 +98,7 @@ pub trait BlindRotationKeyEncryptSk<B: Backend> {
#[derive(Clone)]
pub struct BlindRotationKey<D: Data, BRT: BlindRotationAlgo> {
pub(crate) keys: Vec<GGSWCiphertext<D>>,
pub(crate) keys: Vec<GGSW<D>>,
pub(crate) dist: Distribution,
pub(crate) _phantom: PhantomData<BRT>,
}

View File

@@ -9,7 +9,7 @@ use poulpy_core::{
Distribution,
layouts::{
Base2K, Degree, Dnum, Dsize, GGSWInfos, GLWEInfos, LWEInfos, Rank, TorusPrecision,
prepared::{GGSWCiphertextPrepared, Prepare, PrepareAlloc},
prepared::{GGSWPrepared, Prepare, PrepareAlloc},
},
};
@@ -23,7 +23,7 @@ pub trait BlindRotationKeyPreparedAlloc<B: Backend> {
#[derive(PartialEq, Eq)]
pub struct BlindRotationKeyPrepared<D: Data, BRT: BlindRotationAlgo, B: Backend> {
pub(crate) data: Vec<GGSWCiphertextPrepared<D, B>>,
pub(crate) data: Vec<GGSWPrepared<D, B>>,
pub(crate) dist: Distribution,
pub(crate) x_pow_a: Option<Vec<SvpPPol<Vec<u8>, B>>>,
pub(crate) _phantom: PhantomData<BRT>,