pub struct LweBootstrapKey64(/* private fields */);Expand description
A structure representing an LWE bootstrap key with 64 bits of precision.
Trait Implementations§
Source§impl AbstractEntity for LweBootstrapKey64
impl AbstractEntity for LweBootstrapKey64
Source§type Kind = LweBootstrapKeyKind
type Kind = LweBootstrapKeyKind
Source§impl Clone for LweBootstrapKey64
impl Clone for LweBootstrapKey64
Source§fn clone(&self) -> LweBootstrapKey64
fn clone(&self) -> LweBootstrapKey64
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LweBootstrapKey64
impl Debug for LweBootstrapKey64
Source§impl EntityDeserializationEngine<&[u8], LweBootstrapKey64> for DefaultSerializationEngine
§Description:
Implementation of EntityDeserializationEngine for DefaultSerializationEngine that
operates on 64 bits integers. It deserializes a LWE bootstrap key entity.
impl EntityDeserializationEngine<&[u8], LweBootstrapKey64> for DefaultSerializationEngine
§Description:
Implementation of EntityDeserializationEngine for DefaultSerializationEngine that
operates on 64 bits integers. It deserializes a LWE bootstrap key entity.
Source§fn deserialize(
&mut self,
serialized: &[u8],
) -> Result<LweBootstrapKey64, EntityDeserializationError<Self::EngineError>>
fn deserialize( &mut self, serialized: &[u8], ) -> Result<LweBootstrapKey64, EntityDeserializationError<Self::EngineError>>
§Example
use concrete_core::prelude::{
DecompositionBaseLog, DecompositionLevelCount, GlweDimension, LweDimension, PolynomialSize,
Variance, *,
};
// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let (lwe_dim, glwe_dim, poly_size) = (LweDimension(4), GlweDimension(6), PolynomialSize(256));
let (dec_lc, dec_bl) = (DecompositionLevelCount(3), DecompositionBaseLog(5));
let noise = Variance(2_f64.powf(-25.));
// Unix seeder must be given a secret input.
// Here we just give it 0, which is totally unsafe.
const UNSAFE_SECRET: u128 = 0;
let mut engine = DefaultEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let lwe_sk: LweSecretKey64 = engine.generate_new_lwe_secret_key(lwe_dim)?;
let glwe_sk: GlweSecretKey64 = engine.generate_new_glwe_secret_key(glwe_dim, poly_size)?;
let bsk: LweBootstrapKey64 =
engine.generate_new_lwe_bootstrap_key(&lwe_sk, &glwe_sk, dec_bl, dec_lc, noise)?;
let mut serialization_engine = DefaultSerializationEngine::new(())?;
let serialized = serialization_engine.serialize(&bsk)?;
let recovered = serialization_engine.deserialize(serialized.as_slice())?;
assert_eq!(bsk, recovered);
Source§unsafe fn deserialize_unchecked(
&mut self,
serialized: &[u8],
) -> LweBootstrapKey64
unsafe fn deserialize_unchecked( &mut self, serialized: &[u8], ) -> LweBootstrapKey64
Source§impl EntitySerializationEngine<LweBootstrapKey64, Vec<u8>> for DefaultSerializationEngine
§Description:
Implementation of EntitySerializationEngine for DefaultSerializationEngine that operates
on 64 bits integers. It serializes a LWE bootstrap key entity.
impl EntitySerializationEngine<LweBootstrapKey64, Vec<u8>> for DefaultSerializationEngine
§Description:
Implementation of EntitySerializationEngine for DefaultSerializationEngine that operates
on 64 bits integers. It serializes a LWE bootstrap key entity.
Source§fn serialize(
&mut self,
entity: &LweBootstrapKey64,
) -> Result<Vec<u8>, EntitySerializationError<Self::EngineError>>
fn serialize( &mut self, entity: &LweBootstrapKey64, ) -> Result<Vec<u8>, EntitySerializationError<Self::EngineError>>
§Example
use concrete_core::prelude::{
DecompositionBaseLog, DecompositionLevelCount, GlweDimension, LweDimension, PolynomialSize,
Variance, *,
};
// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let (lwe_dim, glwe_dim, poly_size) = (LweDimension(4), GlweDimension(6), PolynomialSize(256));
let (dec_lc, dec_bl) = (DecompositionLevelCount(3), DecompositionBaseLog(5));
let noise = Variance(2_f64.powf(-25.));
// Unix seeder must be given a secret input.
// Here we just give it 0, which is totally unsafe.
const UNSAFE_SECRET: u128 = 0;
let mut engine = DefaultEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let lwe_sk: LweSecretKey64 = engine.generate_new_lwe_secret_key(lwe_dim)?;
let glwe_sk: GlweSecretKey64 = engine.generate_new_glwe_secret_key(glwe_dim, poly_size)?;
let bsk: LweBootstrapKey64 =
engine.generate_new_lwe_bootstrap_key(&lwe_sk, &glwe_sk, dec_bl, dec_lc, noise)?;
let mut serialization_engine = DefaultSerializationEngine::new(())?;
let serialized = serialization_engine.serialize(&bsk)?;
let recovered = serialization_engine.deserialize(serialized.as_slice())?;
assert_eq!(bsk, recovered);
Source§unsafe fn serialize_unchecked(&mut self, entity: &LweBootstrapKey64) -> Vec<u8> ⓘ
unsafe fn serialize_unchecked(&mut self, entity: &LweBootstrapKey64) -> Vec<u8> ⓘ
Source§impl LweBootstrapKeyConsumingRetrievalEngine<LweBootstrapKey64, Vec<u64>> for DefaultEngine
impl LweBootstrapKeyConsumingRetrievalEngine<LweBootstrapKey64, Vec<u64>> for DefaultEngine
Source§fn consume_retrieve_lwe_bootstrap_key(
&mut self,
bootstrap_key: LweBootstrapKey64,
) -> Result<Vec<u64>, LweBootstrapKeyConsumingRetrievalError<Self::EngineError>>
fn consume_retrieve_lwe_bootstrap_key( &mut self, bootstrap_key: LweBootstrapKey64, ) -> Result<Vec<u64>, LweBootstrapKeyConsumingRetrievalError<Self::EngineError>>
§Example:
use concrete_core::prelude::{
DecompositionBaseLog, DecompositionLevelCount, GlweDimension, LweDimension, PolynomialSize,
*,
};
// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(2);
let glwe_size = GlweSize(2);
let polynomial_size = PolynomialSize(256);
let level = DecompositionLevelCount(2);
let base_log = DecompositionBaseLog(1);
// Unix seeder must be given a secret input.
// Here we just give it 0, which is totally unsafe.
const UNSAFE_SECRET: u128 = 0;
let mut engine = DefaultEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let owned_container =
vec![0_u64; lwe_dimension.0 * level.0 * glwe_size.0 * glwe_size.0 * polynomial_size.0];
let original_vec_ptr = owned_container.as_ptr();
let lwe_bootstrap_key: LweBootstrapKey64 = engine.create_lwe_bootstrap_key_from(
owned_container,
glwe_size,
polynomial_size,
base_log,
level,
)?;
let retrieved_container = engine.consume_retrieve_lwe_bootstrap_key(lwe_bootstrap_key)?;
assert_eq!(original_vec_ptr, retrieved_container.as_ptr());Source§unsafe fn consume_retrieve_lwe_bootstrap_key_unchecked(
&mut self,
bootstrap_key: LweBootstrapKey64,
) -> Vec<u64>
unsafe fn consume_retrieve_lwe_bootstrap_key_unchecked( &mut self, bootstrap_key: LweBootstrapKey64, ) -> Vec<u64>
Source§impl LweBootstrapKeyConversionEngine<LweBootstrapKey64, FftFourierLweBootstrapKey64> for FftEngine
§Description
Implementation of LweBootstrapKeyConversionEngine for FftEngine that operates on
64 bit integers. It converts a bootstrap key from the standard to the Fourier domain.
impl LweBootstrapKeyConversionEngine<LweBootstrapKey64, FftFourierLweBootstrapKey64> for FftEngine
§Description
Implementation of LweBootstrapKeyConversionEngine for FftEngine that operates on
64 bit integers. It converts a bootstrap key from the standard to the Fourier domain.
Source§fn convert_lwe_bootstrap_key(
&mut self,
input: &LweBootstrapKey64,
) -> Result<FftFourierLweBootstrapKey64, LweBootstrapKeyConversionError<Self::EngineError>>
fn convert_lwe_bootstrap_key( &mut self, input: &LweBootstrapKey64, ) -> Result<FftFourierLweBootstrapKey64, LweBootstrapKeyConversionError<Self::EngineError>>
§Example
use concrete_core::prelude::{
DecompositionBaseLog, DecompositionLevelCount, GlweDimension, LweDimension, PolynomialSize,
Variance, *,
};
// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let (lwe_dim, glwe_dim, poly_size) = (LweDimension(4), GlweDimension(6), PolynomialSize(256));
let (dec_lc, dec_bl) = (DecompositionLevelCount(3), DecompositionBaseLog(5));
let noise = Variance(2_f64.powf(-25.));
// Unix seeder must be given a secret input.
// Here we just give it 0, which is totally unsafe.
const UNSAFE_SECRET: u128 = 0;
let mut default_engine = DefaultEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let mut fft_engine = FftEngine::new(())?;
let lwe_sk: LweSecretKey64 = default_engine.generate_new_lwe_secret_key(lwe_dim)?;
let glwe_sk: GlweSecretKey64 =
default_engine.generate_new_glwe_secret_key(glwe_dim, poly_size)?;
let bsk: LweBootstrapKey64 =
default_engine.generate_new_lwe_bootstrap_key(&lwe_sk, &glwe_sk, dec_bl, dec_lc, noise)?;
let fourier_bsk: FftFourierLweBootstrapKey64 = fft_engine.convert_lwe_bootstrap_key(&bsk)?;
assert_eq!(fourier_bsk.glwe_dimension(), glwe_dim);
assert_eq!(fourier_bsk.polynomial_size(), poly_size);
assert_eq!(fourier_bsk.input_lwe_dimension(), lwe_dim);
assert_eq!(fourier_bsk.decomposition_base_log(), dec_bl);
assert_eq!(fourier_bsk.decomposition_level_count(), dec_lc);
Source§unsafe fn convert_lwe_bootstrap_key_unchecked(
&mut self,
input: &LweBootstrapKey64,
) -> FftFourierLweBootstrapKey64
unsafe fn convert_lwe_bootstrap_key_unchecked( &mut self, input: &LweBootstrapKey64, ) -> FftFourierLweBootstrapKey64
Source§impl LweBootstrapKeyCreationEngine<Vec<u64>, LweBootstrapKey64> for DefaultEngine
impl LweBootstrapKeyCreationEngine<Vec<u64>, LweBootstrapKey64> for DefaultEngine
Source§fn create_lwe_bootstrap_key_from(
&mut self,
container: Vec<u64>,
glwe_size: GlweSize,
poly_size: PolynomialSize,
decomposition_base_log: DecompositionBaseLog,
decomposition_level_count: DecompositionLevelCount,
) -> Result<LweBootstrapKey64, LweBootstrapKeyCreationError<Self::EngineError>>
fn create_lwe_bootstrap_key_from( &mut self, container: Vec<u64>, glwe_size: GlweSize, poly_size: PolynomialSize, decomposition_base_log: DecompositionBaseLog, decomposition_level_count: DecompositionLevelCount, ) -> Result<LweBootstrapKey64, LweBootstrapKeyCreationError<Self::EngineError>>
§Example:
use concrete_core::prelude::{
DecompositionBaseLog, DecompositionLevelCount, GlweDimension, LweDimension, PolynomialSize,
*,
};
// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(2);
let glwe_size = GlweSize(2);
let polynomial_size = PolynomialSize(256);
let level = DecompositionLevelCount(2);
let base_log = DecompositionBaseLog(1);
// Unix seeder must be given a secret input.
// Here we just give it 0, which is totally unsafe.
const UNSAFE_SECRET: u128 = 0;
let mut engine = DefaultEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let owned_container =
vec![0_u64; lwe_dimension.0 * level.0 * glwe_size.0 * glwe_size.0 * polynomial_size.0];
let lwe_bootstrap_key: LweBootstrapKey64 = engine.create_lwe_bootstrap_key_from(
owned_container,
glwe_size,
polynomial_size,
base_log,
level,
)?;
Source§unsafe fn create_lwe_bootstrap_key_from_unchecked(
&mut self,
container: Vec<u64>,
glwe_size: GlweSize,
poly_size: PolynomialSize,
decomposition_base_log: DecompositionBaseLog,
decomposition_level_count: DecompositionLevelCount,
) -> LweBootstrapKey64
unsafe fn create_lwe_bootstrap_key_from_unchecked( &mut self, container: Vec<u64>, glwe_size: GlweSize, poly_size: PolynomialSize, decomposition_base_log: DecompositionBaseLog, decomposition_level_count: DecompositionLevelCount, ) -> LweBootstrapKey64
Source§impl LweBootstrapKeyDiscardingConversionEngine<LweBootstrapKey64, LweBootstrapKeyMutView64<'_>> for DefaultEngine
impl LweBootstrapKeyDiscardingConversionEngine<LweBootstrapKey64, LweBootstrapKeyMutView64<'_>> for DefaultEngine
Source§fn discard_convert_lwe_bootstrap_key(
&mut self,
output: &mut LweBootstrapKeyMutView64<'_>,
input: &LweBootstrapKey64,
) -> Result<(), LweBootstrapKeyDiscardingConversionError<Self::EngineError>>
fn discard_convert_lwe_bootstrap_key( &mut self, output: &mut LweBootstrapKeyMutView64<'_>, input: &LweBootstrapKey64, ) -> Result<(), LweBootstrapKeyDiscardingConversionError<Self::EngineError>>
§Example
use concrete_core::prelude::{
DecompositionBaseLog, DecompositionLevelCount, GlweDimension, LweDimension, PolynomialSize,
Variance, *,
};
// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let (lwe_dim, glwe_dim, poly_size) = (LweDimension(4), GlweDimension(6), PolynomialSize(256));
let (dec_lc, dec_bl) = (DecompositionLevelCount(3), DecompositionBaseLog(5));
let noise = Variance(2_f64.powf(-25.));
// Unix seeder must be given a secret input.
// Here we just give it 0, which is totally unsafe.
const UNSAFE_SECRET: u128 = 0;
let mut default_engine = DefaultEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let lwe_sk: LweSecretKey64 = default_engine.generate_new_lwe_secret_key(lwe_dim)?;
let glwe_sk: GlweSecretKey64 =
default_engine.generate_new_glwe_secret_key(glwe_dim, poly_size)?;
let bsk: LweBootstrapKey64 =
default_engine.generate_new_lwe_bootstrap_key(&lwe_sk, &glwe_sk, dec_bl, dec_lc, noise)?;
let mut owned_container = vec![
0_u64;
lwe_dim.0
* dec_lc.0
* glwe_dim.to_glwe_size().0
* glwe_dim.to_glwe_size().0
* poly_size.0
];
let mut out_bsk_mut_view: LweBootstrapKeyMutView64 = default_engine
.create_lwe_bootstrap_key_from(
owned_container.as_mut_slice(),
glwe_dim.to_glwe_size(),
poly_size,
dec_bl,
dec_lc,
)?;
default_engine.discard_convert_lwe_bootstrap_key(&mut out_bsk_mut_view, &bsk)?;
assert_eq!(out_bsk_mut_view.glwe_dimension(), glwe_dim);
assert_eq!(out_bsk_mut_view.polynomial_size(), poly_size);
assert_eq!(out_bsk_mut_view.input_lwe_dimension(), lwe_dim);
assert_eq!(out_bsk_mut_view.decomposition_base_log(), dec_bl);
assert_eq!(out_bsk_mut_view.decomposition_level_count(), dec_lc);
// Check content is the same
let original_bsk_container = default_engine.consume_retrieve_lwe_bootstrap_key(bsk)?;
let mut_view_bsk_container =
default_engine.consume_retrieve_lwe_bootstrap_key(out_bsk_mut_view)?;
assert_eq!(original_bsk_container, mut_view_bsk_container);
Source§unsafe fn discard_convert_lwe_bootstrap_key_unchecked(
&mut self,
output: &mut LweBootstrapKeyMutView64<'_>,
input: &LweBootstrapKey64,
)
unsafe fn discard_convert_lwe_bootstrap_key_unchecked( &mut self, output: &mut LweBootstrapKeyMutView64<'_>, input: &LweBootstrapKey64, )
Source§impl LweBootstrapKeyEntity for LweBootstrapKey64
impl LweBootstrapKeyEntity for LweBootstrapKey64
Source§fn glwe_dimension(&self) -> GlweDimension
fn glwe_dimension(&self) -> GlweDimension
Source§fn polynomial_size(&self) -> PolynomialSize
fn polynomial_size(&self) -> PolynomialSize
Source§fn input_lwe_dimension(&self) -> LweDimension
fn input_lwe_dimension(&self) -> LweDimension
Source§fn decomposition_base_log(&self) -> DecompositionBaseLog
fn decomposition_base_log(&self) -> DecompositionBaseLog
Source§fn decomposition_level_count(&self) -> DecompositionLevelCount
fn decomposition_level_count(&self) -> DecompositionLevelCount
Source§fn output_lwe_dimension(&self) -> LweDimension
fn output_lwe_dimension(&self) -> LweDimension
Source§impl LweBootstrapKeyGenerationEngine<LweSecretKey64, GlweSecretKey64, LweBootstrapKey64> for DefaultEngine
§Description:
Implementation of LweBootstrapKeyGenerationEngine for DefaultEngine that operates on
64 bits integers. It outputs a bootstrap key in the standard domain.
impl LweBootstrapKeyGenerationEngine<LweSecretKey64, GlweSecretKey64, LweBootstrapKey64> for DefaultEngine
§Description:
Implementation of LweBootstrapKeyGenerationEngine for DefaultEngine that operates on
64 bits integers. It outputs a bootstrap key in the standard domain.
Source§fn generate_new_lwe_bootstrap_key(
&mut self,
input_key: &LweSecretKey64,
output_key: &GlweSecretKey64,
decomposition_base_log: DecompositionBaseLog,
decomposition_level_count: DecompositionLevelCount,
noise: Variance,
) -> Result<LweBootstrapKey64, LweBootstrapKeyGenerationError<Self::EngineError>>
fn generate_new_lwe_bootstrap_key( &mut self, input_key: &LweSecretKey64, output_key: &GlweSecretKey64, decomposition_base_log: DecompositionBaseLog, decomposition_level_count: DecompositionLevelCount, noise: Variance, ) -> Result<LweBootstrapKey64, LweBootstrapKeyGenerationError<Self::EngineError>>
§Example
use concrete_core::prelude::{
DecompositionBaseLog, DecompositionLevelCount, GlweDimension, LweDimension, PolynomialSize,
Variance, *,
};
// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let (lwe_dim, glwe_dim, poly_size) = (LweDimension(4), GlweDimension(6), PolynomialSize(256));
let (dec_lc, dec_bl) = (DecompositionLevelCount(3), DecompositionBaseLog(5));
let noise = Variance(2_f64.powf(-25.));
// Unix seeder must be given a secret input.
// Here we just give it 0, which is totally unsafe.
const UNSAFE_SECRET: u128 = 0;
let mut engine = DefaultEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let lwe_sk: LweSecretKey64 = engine.generate_new_lwe_secret_key(lwe_dim)?;
let glwe_sk: GlweSecretKey64 = engine.generate_new_glwe_secret_key(glwe_dim, poly_size)?;
let bsk: LweBootstrapKey64 =
engine.generate_new_lwe_bootstrap_key(&lwe_sk, &glwe_sk, dec_bl, dec_lc, noise)?;
assert_eq!(bsk.glwe_dimension(), glwe_dim);
assert_eq!(bsk.polynomial_size(), poly_size);
assert_eq!(bsk.input_lwe_dimension(), lwe_dim);
assert_eq!(bsk.decomposition_base_log(), dec_bl);
assert_eq!(bsk.decomposition_level_count(), dec_lc);
Source§unsafe fn generate_new_lwe_bootstrap_key_unchecked(
&mut self,
input_key: &LweSecretKey64,
output_key: &GlweSecretKey64,
decomposition_base_log: DecompositionBaseLog,
decomposition_level_count: DecompositionLevelCount,
noise: Variance,
) -> LweBootstrapKey64
unsafe fn generate_new_lwe_bootstrap_key_unchecked( &mut self, input_key: &LweSecretKey64, output_key: &GlweSecretKey64, decomposition_base_log: DecompositionBaseLog, decomposition_level_count: DecompositionLevelCount, noise: Variance, ) -> LweBootstrapKey64
Source§impl LweBootstrapKeyGenerationEngine<LweSecretKey64, GlweSecretKey64, LweBootstrapKey64> for DefaultParallelEngine
§Description:
Implementation of LweBootstrapKeyGenerationEngine for DefaultParallelEngine that
operates on 64 bits integers. It outputs a bootstrap key in the standard domain.
impl LweBootstrapKeyGenerationEngine<LweSecretKey64, GlweSecretKey64, LweBootstrapKey64> for DefaultParallelEngine
§Description:
Implementation of LweBootstrapKeyGenerationEngine for DefaultParallelEngine that
operates on 64 bits integers. It outputs a bootstrap key in the standard domain.
Source§fn generate_new_lwe_bootstrap_key(
&mut self,
input_key: &LweSecretKey64,
output_key: &GlweSecretKey64,
decomposition_base_log: DecompositionBaseLog,
decomposition_level_count: DecompositionLevelCount,
noise: Variance,
) -> Result<LweBootstrapKey64, LweBootstrapKeyGenerationError<Self::EngineError>>
fn generate_new_lwe_bootstrap_key( &mut self, input_key: &LweSecretKey64, output_key: &GlweSecretKey64, decomposition_base_log: DecompositionBaseLog, decomposition_level_count: DecompositionLevelCount, noise: Variance, ) -> Result<LweBootstrapKey64, LweBootstrapKeyGenerationError<Self::EngineError>>
§Example
use concrete_core::prelude::{
DecompositionBaseLog, DecompositionLevelCount, GlweDimension, LweDimension, PolynomialSize,
Variance, *,
};
// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let (lwe_dim, glwe_dim, poly_size) = (LweDimension(4), GlweDimension(6), PolynomialSize(256));
let (dec_lc, dec_bl) = (DecompositionLevelCount(3), DecompositionBaseLog(5));
let noise = Variance(2_f64.powf(-25.));
// Unix seeder must be given a secret input.
// Here we just give it 0, which is totally unsafe.
const UNSAFE_SECRET: u128 = 0;
let mut default_engine = DefaultEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let mut default_parallel_engine =
DefaultParallelEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let lwe_sk: LweSecretKey64 = default_engine.generate_new_lwe_secret_key(lwe_dim)?;
let glwe_sk: GlweSecretKey64 =
default_engine.generate_new_glwe_secret_key(glwe_dim, poly_size)?;
let bsk: LweBootstrapKey64 = default_parallel_engine
.generate_new_lwe_bootstrap_key(&lwe_sk, &glwe_sk, dec_bl, dec_lc, noise)?;
assert_eq!(bsk.glwe_dimension(), glwe_dim);
assert_eq!(bsk.polynomial_size(), poly_size);
assert_eq!(bsk.input_lwe_dimension(), lwe_dim);
assert_eq!(bsk.decomposition_base_log(), dec_bl);
assert_eq!(bsk.decomposition_level_count(), dec_lc);
Source§unsafe fn generate_new_lwe_bootstrap_key_unchecked(
&mut self,
input_key: &LweSecretKey64,
output_key: &GlweSecretKey64,
decomposition_base_log: DecompositionBaseLog,
decomposition_level_count: DecompositionLevelCount,
noise: Variance,
) -> LweBootstrapKey64
unsafe fn generate_new_lwe_bootstrap_key_unchecked( &mut self, input_key: &LweSecretKey64, output_key: &GlweSecretKey64, decomposition_base_log: DecompositionBaseLog, decomposition_level_count: DecompositionLevelCount, noise: Variance, ) -> LweBootstrapKey64
Source§impl LweSeededBootstrapKeyToLweBootstrapKeyTransformationEngine<LweSeededBootstrapKey64, LweBootstrapKey64> for DefaultEngine
§Description:
Implementation of LweSeededBootstrapKeyToLweBootstrapKeyTransformationEngine for
DefaultEngine that operates on 64 bits integers. It outputs a bootstrap key in the
standard domain.
impl LweSeededBootstrapKeyToLweBootstrapKeyTransformationEngine<LweSeededBootstrapKey64, LweBootstrapKey64> for DefaultEngine
§Description:
Implementation of LweSeededBootstrapKeyToLweBootstrapKeyTransformationEngine for
DefaultEngine that operates on 64 bits integers. It outputs a bootstrap key in the
standard domain.
Source§fn transform_lwe_seeded_bootstrap_key_to_lwe_bootstrap_key(
&mut self,
lwe_seeded_bootstrap_key: LweSeededBootstrapKey64,
) -> Result<LweBootstrapKey64, LweSeededBootstrapKeyToLweBootstrapKeyTransformationError<Self::EngineError>>
fn transform_lwe_seeded_bootstrap_key_to_lwe_bootstrap_key( &mut self, lwe_seeded_bootstrap_key: LweSeededBootstrapKey64, ) -> Result<LweBootstrapKey64, LweSeededBootstrapKeyToLweBootstrapKeyTransformationError<Self::EngineError>>
use concrete_core::prelude::{
DecompositionBaseLog, DecompositionLevelCount, GlweDimension, LweDimension, PolynomialSize,
Variance, *,
};
// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let (lwe_dim, glwe_dim, poly_size) = (LweDimension(4), GlweDimension(6), PolynomialSize(256));
let (dec_lc, dec_bl) = (DecompositionLevelCount(3), DecompositionBaseLog(5));
let noise = Variance(2_f64.powf(-25.));
// Unix seeder must be given a secret input.
// Here we just give it 0, which is totally unsafe.
const UNSAFE_SECRET: u128 = 0;
let mut engine = DefaultEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let lwe_sk: LweSecretKey64 = engine.generate_new_lwe_secret_key(lwe_dim)?;
let glwe_sk: GlweSecretKey64 = engine.generate_new_glwe_secret_key(glwe_dim, poly_size)?;
let seeded_bsk: LweSeededBootstrapKey64 =
engine.generate_new_lwe_seeded_bootstrap_key(&lwe_sk, &glwe_sk, dec_bl, dec_lc, noise)?;
let bsk = engine.transform_lwe_seeded_bootstrap_key_to_lwe_bootstrap_key(seeded_bsk)?;
assert_eq!(bsk.glwe_dimension(), glwe_dim);
assert_eq!(bsk.polynomial_size(), poly_size);
assert_eq!(bsk.input_lwe_dimension(), lwe_dim);
assert_eq!(bsk.decomposition_base_log(), dec_bl);
assert_eq!(bsk.decomposition_level_count(), dec_lc);
Source§unsafe fn transform_lwe_seeded_bootstrap_key_to_lwe_bootstrap_key_unchecked(
&mut self,
lwe_seeded_bootstrap_key: LweSeededBootstrapKey64,
) -> LweBootstrapKey64
unsafe fn transform_lwe_seeded_bootstrap_key_to_lwe_bootstrap_key_unchecked( &mut self, lwe_seeded_bootstrap_key: LweSeededBootstrapKey64, ) -> LweBootstrapKey64
Source§impl PartialEq for LweBootstrapKey64
impl PartialEq for LweBootstrapKey64
impl Eq for LweBootstrapKey64
impl StructuralPartialEq for LweBootstrapKey64
Auto Trait Implementations§
impl Freeze for LweBootstrapKey64
impl RefUnwindSafe for LweBootstrapKey64
impl Send for LweBootstrapKey64
impl Sync for LweBootstrapKey64
impl Unpin for LweBootstrapKey64
impl UnwindSafe for LweBootstrapKey64
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more