pub struct LweSeededBootstrapKey64(_);
Expand description

A structure representing an LWE bootstrap key with 64 bits of precision.

Trait Implementations

The kind of the entity.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Destroys an entity.

Unsafely destroys an entity. Read more

Description:

Implementation of LweSeededBootstrapKeyCreationEngine for DefaultEngine that operates on 64 bits integers. It outputs a seeded bootstrap key in the standard domain.

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)?;

Unsafely creates a seeded LWE bootstrap key. Read more

The distribution of key the input ciphertext is encrypted with.

The distribution of the key the output ciphertext is encrypted with.

Returns the GLWE dimension of the key.

Returns the polynomial size of the key.

Returns the input LWE dimension of the key.

Returns the number of decomposition levels of the key.

Returns the logarithm of the base used in the key.

Returns the compression seed used to generate the seeded LWE bootstrap key during encryption. Read more

Returns the output LWE dimension of the key.

Description:

Implementation of LweSeededBootstrapKeyToLweBootstrapKeyTransformationEngine for DefaultEngine that operates on 64 bits integers. It outputs a bootstrap key in the standard domain.

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)?;

Unsafely transforms an LWE seeded bootstrap key into an LWE bootstrap key Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.