mirror of
https://github.com/zama-ai/tfhe-rs.git
synced 2026-01-10 07:08:03 -05:00
chore(core): remove feature gate for multi-bit PBS
This commit is contained in:
@@ -66,8 +66,7 @@ integer = ["shortint"]
|
||||
internal-keycache = ["lazy_static", "fs2", "bincode"]
|
||||
|
||||
# Experimental section
|
||||
experimental = ["experimental-multi_bit_pbs"]
|
||||
experimental-multi_bit_pbs = []
|
||||
experimental = []
|
||||
experimental-force_fft_algo_dif4 = []
|
||||
# End experimental section
|
||||
|
||||
|
||||
@@ -13,11 +13,8 @@ pub mod lwe_encryption;
|
||||
pub mod lwe_keyswitch;
|
||||
pub mod lwe_keyswitch_key_generation;
|
||||
pub mod lwe_linear_algebra;
|
||||
#[cfg(feature = "experimental-multi_bit_pbs")]
|
||||
pub mod lwe_multi_bit_bootstrap_key_conversion;
|
||||
#[cfg(feature = "experimental-multi_bit_pbs")]
|
||||
pub mod lwe_multi_bit_bootstrap_key_generation;
|
||||
#[cfg(feature = "experimental-multi_bit_pbs")]
|
||||
pub mod lwe_multi_bit_programmable_bootstrapping;
|
||||
pub mod lwe_private_functional_packing_keyswitch;
|
||||
pub mod lwe_private_functional_packing_keyswitch_key_generation;
|
||||
@@ -50,11 +47,8 @@ pub use lwe_encryption::*;
|
||||
pub use lwe_keyswitch::*;
|
||||
pub use lwe_keyswitch_key_generation::*;
|
||||
pub use lwe_linear_algebra::*;
|
||||
#[cfg(feature = "experimental-multi_bit_pbs")]
|
||||
pub use lwe_multi_bit_bootstrap_key_conversion::*;
|
||||
#[cfg(feature = "experimental-multi_bit_pbs")]
|
||||
pub use lwe_multi_bit_bootstrap_key_generation::*;
|
||||
#[cfg(feature = "experimental-multi_bit_pbs")]
|
||||
pub use lwe_multi_bit_programmable_bootstrapping::*;
|
||||
pub use lwe_private_functional_packing_keyswitch::*;
|
||||
pub use lwe_private_functional_packing_keyswitch_key_generation::*;
|
||||
|
||||
@@ -7,11 +7,9 @@ use crate::core_crypto::commons::math::random::{
|
||||
};
|
||||
use crate::core_crypto::commons::math::torus::UnsignedTorus;
|
||||
use crate::core_crypto::commons::numeric::UnsignedInteger;
|
||||
#[cfg(feature = "experimental-multi_bit_pbs")]
|
||||
use crate::core_crypto::commons::parameters::LweBskGroupingFactor;
|
||||
use crate::core_crypto::commons::parameters::{
|
||||
DecompositionLevelCount, FunctionalPackingKeyswitchKeyCount, GlweDimension, GlweSize,
|
||||
LweCiphertextCount, LweDimension, LweSize, PolynomialSize,
|
||||
LweBskGroupingFactor, LweCiphertextCount, LweDimension, LweSize, PolynomialSize,
|
||||
};
|
||||
use concrete_csprng::generators::ForkError;
|
||||
use rayon::prelude::*;
|
||||
@@ -75,7 +73,6 @@ impl<G: ByteRandomGenerator> EncryptionRandomGenerator<G> {
|
||||
}
|
||||
|
||||
// Forks the generator, when splitting a multi_bit bootstrap key into ggsw ciphertext groups.
|
||||
#[cfg(feature = "experimental-multi_bit_pbs")]
|
||||
pub(crate) fn fork_multi_bit_bsk_to_ggsw_group<T: UnsignedInteger>(
|
||||
&mut self,
|
||||
lwe_dimension: LweDimension,
|
||||
@@ -265,7 +262,6 @@ impl<G: ParallelByteRandomGenerator> EncryptionRandomGenerator<G> {
|
||||
}
|
||||
|
||||
// Forks the generator, when splitting a multi_bit bootstrap key into ggsw ct.
|
||||
#[cfg(feature = "experimental-multi_bit_pbs")]
|
||||
pub(crate) fn par_fork_multi_bit_bsk_to_ggsw_group<T: UnsignedInteger>(
|
||||
&mut self,
|
||||
lwe_dimension: LweDimension,
|
||||
|
||||
@@ -205,27 +205,20 @@ pub struct FunctionalPackingKeyswitchKeyCount(pub usize);
|
||||
#[derive(Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)]
|
||||
pub struct CiphertextModulusLog(pub usize);
|
||||
|
||||
#[cfg(feature = "experimental-multi_bit_pbs")]
|
||||
pub mod experimental_multi_bit_pbs {
|
||||
use serde::{Deserialize, Serialize};
|
||||
/// The number of cpu execution thread to use
|
||||
#[derive(Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)]
|
||||
pub struct ThreadCount(pub usize);
|
||||
/// The number of cpu execution thread to use
|
||||
#[derive(Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)]
|
||||
pub struct ThreadCount(pub usize);
|
||||
|
||||
/// The number of key bits grouped together in the multi_bit PBS
|
||||
#[derive(Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)]
|
||||
pub struct LweBskGroupingFactor(pub usize);
|
||||
/// The number of key bits grouped together in the multi_bit PBS
|
||||
#[derive(Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)]
|
||||
pub struct LweBskGroupingFactor(pub usize);
|
||||
|
||||
impl LweBskGroupingFactor {
|
||||
pub fn ggsw_per_multi_bit_element(&self) -> GgswPerLweMultiBitBskElement {
|
||||
GgswPerLweMultiBitBskElement(1 << self.0)
|
||||
}
|
||||
impl LweBskGroupingFactor {
|
||||
pub fn ggsw_per_multi_bit_element(&self) -> GgswPerLweMultiBitBskElement {
|
||||
GgswPerLweMultiBitBskElement(1 << self.0)
|
||||
}
|
||||
|
||||
/// The number of GGSW ciphertexts required per multi_bit BSK element
|
||||
#[derive(Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)]
|
||||
pub struct GgswPerLweMultiBitBskElement(pub usize);
|
||||
}
|
||||
|
||||
#[cfg(feature = "experimental-multi_bit_pbs")]
|
||||
pub use experimental_multi_bit_pbs::*;
|
||||
/// The number of GGSW ciphertexts required per multi_bit BSK element
|
||||
#[derive(Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)]
|
||||
pub struct GgswPerLweMultiBitBskElement(pub usize);
|
||||
|
||||
@@ -14,7 +14,6 @@ pub mod lwe_bootstrap_key;
|
||||
pub mod lwe_ciphertext;
|
||||
pub mod lwe_ciphertext_list;
|
||||
pub mod lwe_keyswitch_key;
|
||||
#[cfg(feature = "experimental-multi_bit_pbs")]
|
||||
pub mod lwe_multi_bit_bootstrap_key;
|
||||
pub mod lwe_private_functional_packing_keyswitch_key;
|
||||
pub mod lwe_private_functional_packing_keyswitch_key_list;
|
||||
@@ -50,7 +49,6 @@ pub use lwe_bootstrap_key::*;
|
||||
pub use lwe_ciphertext::*;
|
||||
pub use lwe_ciphertext_list::*;
|
||||
pub use lwe_keyswitch_key::*;
|
||||
#[cfg(feature = "experimental-multi_bit_pbs")]
|
||||
pub use lwe_multi_bit_bootstrap_key::*;
|
||||
pub use lwe_private_functional_packing_keyswitch_key::*;
|
||||
pub use lwe_private_functional_packing_keyswitch_key_list::*;
|
||||
|
||||
Reference in New Issue
Block a user