Struct concrete_core::backends::default::entities::LweSeededBootstrapKey64
source · [−]pub struct LweSeededBootstrapKey64(_);
Expand description
A structure representing an LWE bootstrap key with 64 bits of precision.
Trait Implementations
sourceimpl AbstractEntity for LweSeededBootstrapKey64
impl AbstractEntity for LweSeededBootstrapKey64
type Kind = LweSeededBootstrapKeyKind
type Kind = LweSeededBootstrapKeyKind
The kind of the entity.
sourceimpl Clone for LweSeededBootstrapKey64
impl Clone for LweSeededBootstrapKey64
sourcefn clone(&self) -> LweSeededBootstrapKey64
fn clone(&self) -> LweSeededBootstrapKey64
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for LweSeededBootstrapKey64
impl Debug for LweSeededBootstrapKey64
sourceimpl DestructionEngine<LweSeededBootstrapKey64> for DefaultEngine
impl DestructionEngine<LweSeededBootstrapKey64> for DefaultEngine
sourcefn destroy(
&mut self,
entity: LweSeededBootstrapKey64
) -> Result<(), DestructionError<Self::EngineError>>
fn destroy(
&mut self,
entity: LweSeededBootstrapKey64
) -> Result<(), DestructionError<Self::EngineError>>
Destroys an entity.
sourceunsafe fn destroy_unchecked(&mut self, entity: &mut LweSeededBootstrapKey64)
unsafe fn destroy_unchecked(&mut self, entity: &mut LweSeededBootstrapKey64)
Unsafely destroys an entity. Read more
sourceimpl LweSeededBootstrapKeyCreationEngine<LweSecretKey64, GlweSecretKey64, LweSeededBootstrapKey64> for DefaultEngine
impl LweSeededBootstrapKeyCreationEngine<LweSecretKey64, GlweSecretKey64, LweSeededBootstrapKey64> for DefaultEngine
Description:
Implementation of LweSeededBootstrapKeyCreationEngine
for DefaultEngine
that operates on
64 bits integers. It outputs a seeded bootstrap key in the standard domain.
sourcefn create_lwe_seeded_bootstrap_key(
&mut self,
input_key: &LweSecretKey64,
output_key: &GlweSecretKey64,
decomposition_base_log: DecompositionBaseLog,
decomposition_level_count: DecompositionLevelCount,
noise: Variance
) -> Result<LweSeededBootstrapKey64, LweSeededBootstrapKeyCreationError<Self::EngineError>>
fn create_lwe_seeded_bootstrap_key(
&mut self,
input_key: &LweSecretKey64,
output_key: &GlweSecretKey64,
decomposition_base_log: DecompositionBaseLog,
decomposition_level_count: DecompositionLevelCount,
noise: Variance
) -> Result<LweSeededBootstrapKey64, LweSeededBootstrapKeyCreationError<Self::EngineError>>
Example
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::{
DecompositionBaseLog, DecompositionLevelCount, GlweDimension, LweDimension, PolynomialSize,
};
use concrete_core::prelude::*;
// 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.create_lwe_secret_key(lwe_dim)?;
let glwe_sk: GlweSecretKey64 = engine.create_glwe_secret_key(glwe_dim, poly_size)?;
let bsk: LweSeededBootstrapKey64 =
engine.create_lwe_seeded_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);
engine.destroy(lwe_sk)?;
engine.destroy(glwe_sk)?;
engine.destroy(bsk)?;
sourceunsafe fn create_lwe_seeded_bootstrap_key_unchecked(
&mut self,
input_key: &LweSecretKey64,
output_key: &GlweSecretKey64,
decomposition_base_log: DecompositionBaseLog,
decomposition_level_count: DecompositionLevelCount,
noise: Variance
) -> LweSeededBootstrapKey64
unsafe fn create_lwe_seeded_bootstrap_key_unchecked(
&mut self,
input_key: &LweSecretKey64,
output_key: &GlweSecretKey64,
decomposition_base_log: DecompositionBaseLog,
decomposition_level_count: DecompositionLevelCount,
noise: Variance
) -> LweSeededBootstrapKey64
Unsafely creates a seeded LWE bootstrap key. Read more
sourceimpl LweSeededBootstrapKeyEntity for LweSeededBootstrapKey64
impl LweSeededBootstrapKeyEntity for LweSeededBootstrapKey64
type InputKeyDistribution = BinaryKeyDistribution
type InputKeyDistribution = BinaryKeyDistribution
The distribution of key the input ciphertext is encrypted with.
type OutputKeyDistribution = BinaryKeyDistribution
type OutputKeyDistribution = BinaryKeyDistribution
The distribution of the key the output ciphertext is encrypted with.
sourcefn glwe_dimension(&self) -> GlweDimension
fn glwe_dimension(&self) -> GlweDimension
Returns the GLWE dimension of the key.
sourcefn polynomial_size(&self) -> PolynomialSize
fn polynomial_size(&self) -> PolynomialSize
Returns the polynomial size of the key.
sourcefn input_lwe_dimension(&self) -> LweDimension
fn input_lwe_dimension(&self) -> LweDimension
Returns the input LWE dimension of the key.
sourcefn decomposition_base_log(&self) -> DecompositionBaseLog
fn decomposition_base_log(&self) -> DecompositionBaseLog
Returns the number of decomposition levels of the key.
sourcefn decomposition_level_count(&self) -> DecompositionLevelCount
fn decomposition_level_count(&self) -> DecompositionLevelCount
Returns the logarithm of the base used in the key.
sourcefn compression_seed(&self) -> CompressionSeed
fn compression_seed(&self) -> CompressionSeed
Returns the compression seed used to generate the seeded LWE bootstrap key during encryption. Read more
sourcefn output_lwe_dimension(&self) -> LweDimension
fn output_lwe_dimension(&self) -> LweDimension
Returns the output LWE dimension of the key.
sourceimpl LweSeededBootstrapKeyToLweBootstrapKeyTransformationEngine<LweSeededBootstrapKey64, LweBootstrapKey64> for DefaultEngine
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.
sourcefn transform_lwe_seeded_bootstrap_key_to_lwe_bootstrap_key(
&mut self,
lwe_seeded_bootstrap_key: LweSeededBootstrapKey64
) -> Result<LweBootstrapKey64, LweSeededBootstrapKeyToLweBootstrapKeyTransformationEngineError<Self::EngineError>>
fn transform_lwe_seeded_bootstrap_key_to_lwe_bootstrap_key(
&mut self,
lwe_seeded_bootstrap_key: LweSeededBootstrapKey64
) -> Result<LweBootstrapKey64, LweSeededBootstrapKeyToLweBootstrapKeyTransformationEngineError<Self::EngineError>>
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::{
DecompositionBaseLog, DecompositionLevelCount, GlweDimension, LweDimension, PolynomialSize,
};
use concrete_core::prelude::*;
// 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.create_lwe_secret_key(lwe_dim)?;
let glwe_sk: GlweSecretKey64 = engine.create_glwe_secret_key(glwe_dim, poly_size)?;
let seeded_bsk: LweSeededBootstrapKey64 =
engine.create_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);
engine.destroy(lwe_sk)?;
engine.destroy(glwe_sk)?;
engine.destroy(bsk)?;
sourceunsafe 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
Unsafely transforms an LWE seeded bootstrap key into an LWE bootstrap key Read more
sourceimpl PartialEq<LweSeededBootstrapKey64> for LweSeededBootstrapKey64
impl PartialEq<LweSeededBootstrapKey64> for LweSeededBootstrapKey64
sourcefn eq(&self, other: &LweSeededBootstrapKey64) -> bool
fn eq(&self, other: &LweSeededBootstrapKey64) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &LweSeededBootstrapKey64) -> bool
fn ne(&self, other: &LweSeededBootstrapKey64) -> bool
This method tests for !=
.
impl Eq for LweSeededBootstrapKey64
impl StructuralEq for LweSeededBootstrapKey64
impl StructuralPartialEq for LweSeededBootstrapKey64
Auto Trait Implementations
impl RefUnwindSafe for LweSeededBootstrapKey64
impl Send for LweSeededBootstrapKey64
impl Sync for LweSeededBootstrapKey64
impl Unpin for LweSeededBootstrapKey64
impl UnwindSafe for LweSeededBootstrapKey64
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more