pub struct LweCiphertext64(_);
Expand description

A structure representing an LWE ciphertext 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

Deserialize this value from the given Serde deserializer. Read more

Destroys an entity.

Unsafely destroys an entity. Read more

Description:

Implementation of LweCiphertextCleartextDiscardingMultiplicationEngine for CoreEngine that operates on 64 bits integers.

Example:
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::LweDimension;
use concrete_core::prelude::*;

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(2);
// Here a hard-set encoding is applied (shift by 50 bits)
let input = 3_u64 << 50;
let cleartext_input = 12_u64;
let noise = Variance(2_f64.powf(-25.));

let mut engine = CoreEngine::new()?;
let cleartext: Cleartext64 = engine.create_cleartext(&cleartext_input)?;
let key: LweSecretKey64 = engine.create_lwe_secret_key(lwe_dimension)?;
let plaintext = engine.create_plaintext(&input)?;
let ciphertext_1 = engine.encrypt_lwe_ciphertext(&key, &plaintext, noise)?;
let mut ciphertext_2 = engine.encrypt_lwe_ciphertext(&key, &plaintext, noise)?;

engine.discard_mul_lwe_ciphertext_cleartext(&mut ciphertext_2, &ciphertext_1, &cleartext)?;
assert_eq!(ciphertext_2.lwe_dimension(), lwe_dimension);

engine.destroy(cleartext)?;
engine.destroy(key)?;
engine.destroy(plaintext)?;
engine.destroy(ciphertext_1)?;
engine.destroy(ciphertext_2)?;

Unsafely multiply an LWE ciphertext with a cleartext. Read more

Description:

Implementation of LweCiphertextCleartextFusingMultiplicationEngine for CoreEngine that operates on 64 bits integers.

Example:
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::LweDimension;
use concrete_core::prelude::*;

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(2);
// Here a hard-set encoding is applied (shift by 50 bits)
let input = 3_u64 << 50;
let cleartext_input = 12_u64;
let noise = Variance(2_f64.powf(-25.));

let mut engine = CoreEngine::new()?;
let cleartext: Cleartext64 = engine.create_cleartext(&cleartext_input)?;
let key: LweSecretKey64 = engine.create_lwe_secret_key(lwe_dimension)?;
let plaintext = engine.create_plaintext(&input)?;
let mut ciphertext = engine.encrypt_lwe_ciphertext(&key, &plaintext, noise)?;

engine.fuse_mul_lwe_ciphertext_cleartext(&mut ciphertext, &cleartext)?;
assert_eq!(ciphertext.lwe_dimension(), lwe_dimension);

engine.destroy(key)?;
engine.destroy(plaintext)?;
engine.destroy(ciphertext)?;
engine.destroy(cleartext)?;

Unsafely multiply an LWE ciphertext with a cleartext. Read more

Description:

Implementation of LweCiphertextDecryptionEngine for CoreEngine that operates on 64 bits integers.

Example:
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::LweDimension;
use concrete_core::prelude::*;

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(2);
// Here a hard-set encoding is applied (shift by 50 bits)
let input = 3_u64 << 50;
let noise = Variance(2_f64.powf(-25.));

let mut engine = CoreEngine::new()?;
let key: LweSecretKey64 = engine.create_lwe_secret_key(lwe_dimension)?;
let plaintext = engine.create_plaintext(&input)?;
let ciphertext = engine.encrypt_lwe_ciphertext(&key, &plaintext, noise)?;

let decrypted_plaintext = engine.decrypt_lwe_ciphertext(&key, &ciphertext)?;

engine.destroy(key)?;
engine.destroy(plaintext)?;
engine.destroy(ciphertext)?;
engine.destroy(decrypted_plaintext)?;

Unsafely decrypts an LWE ciphertext. Read more

Description:

Implementation of LweCiphertextDiscardingAdditionEngine for CoreEngine that operates on 64 bits integers.

Example:
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::LweDimension;
use concrete_core::prelude::*;

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(2);
// Here a hard-set encoding is applied (shift by 50 bits)
let input_1 = 3_u64 << 50;
let input_2 = 7_u64 << 50;
let noise = Variance(2_f64.powf(-25.));

let mut engine = CoreEngine::new()?;
let key: LweSecretKey64 = engine.create_lwe_secret_key(lwe_dimension)?;
let plaintext_1 = engine.create_plaintext(&input_1)?;
let plaintext_2 = engine.create_plaintext(&input_2)?;
let ciphertext_1 = engine.encrypt_lwe_ciphertext(&key, &plaintext_1, noise)?;
let ciphertext_2 = engine.encrypt_lwe_ciphertext(&key, &plaintext_2, noise)?;
let mut ciphertext_3 = engine.zero_encrypt_lwe_ciphertext(&key, noise)?;

engine.discard_add_lwe_ciphertext(&mut ciphertext_3, &ciphertext_1, &ciphertext_2)?;
assert_eq!(ciphertext_3.lwe_dimension(), lwe_dimension);

engine.destroy(key)?;
engine.destroy(plaintext_1)?;
engine.destroy(plaintext_2)?;
engine.destroy(ciphertext_1)?;
engine.destroy(ciphertext_2)?;
engine.destroy(ciphertext_3)?;

Unsafely adds two LWE ciphertexts. Read more

Description:

Implementation of LweCiphertextDiscardingBootstrapEngine for CoreEngine that operates on 64 bits integers.

Example
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::{
    DecompositionBaseLog, DecompositionLevelCount, GlweDimension, LweDimension, PolynomialSize,
};
use concrete_core::prelude::*;

// Here a hard-set encoding is applied (shift by 50 bits)
let input = 3_u64 << 50;
// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let (lwe_dim, lwe_dim_output, glwe_dim, poly_size) = (
    LweDimension(4),
    LweDimension(1024),
    GlweDimension(1),
    PolynomialSize(1024),
);
let (dec_lc, dec_bl) = (DecompositionLevelCount(3), DecompositionBaseLog(5));
// A constant function is applied during the bootstrap
let lut = vec![8_u64 << 50; poly_size.0];
let noise = Variance(2_f64.powf(-25.));

let mut engine = CoreEngine::new()?;
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: FourierLweBootstrapKey64 =
    engine.create_lwe_bootstrap_key(&lwe_sk, &glwe_sk, dec_bl, dec_lc, noise)?;
let lwe_sk_output: LweSecretKey64 = engine.create_lwe_secret_key(lwe_dim_output)?;
let plaintext = engine.create_plaintext(&input)?;
let plaintext_vector = engine.create_plaintext_vector(&lut)?;
let acc = engine.encrypt_glwe_ciphertext(&glwe_sk, &plaintext_vector, noise)?;
let input = engine.encrypt_lwe_ciphertext(&lwe_sk, &plaintext, noise)?;
let mut output = engine.encrypt_lwe_ciphertext(&lwe_sk_output, &plaintext, noise)?;

engine.discard_bootstrap_lwe_ciphertext(&mut output, &input, &acc, &bsk)?;
assert_eq!(output.lwe_dimension(), lwe_dim_output);

engine.destroy(lwe_sk)?;
engine.destroy(glwe_sk)?;
engine.destroy(bsk)?;
engine.destroy(lwe_sk_output)?;
engine.destroy(plaintext)?;
engine.destroy(plaintext_vector)?;
engine.destroy(acc)?;
engine.destroy(input)?;
engine.destroy(output)?;

Unsafely bootstrap an LWE ciphertext . Read more

Description:

Implementation of LweCiphertextDiscardingDecryptionEngine for CoreEngine that operates on 64 bits integers.

Example:
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::LweDimension;
use concrete_core::prelude::*;

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(2);
// Here a hard-set encoding is applied (shift by 50 bits)
let input = 3_u64 << 50;
let noise = Variance(2_f64.powf(-25.));

let mut engine = CoreEngine::new()?;
let key: LweSecretKey64 = engine.create_lwe_secret_key(lwe_dimension)?;
let mut plaintext = engine.create_plaintext(&input)?;
let ciphertext = engine.encrypt_lwe_ciphertext(&key, &plaintext, noise)?;

engine.discard_decrypt_lwe_ciphertext(&key, &mut plaintext, &ciphertext)?;
assert_eq!(ciphertext.lwe_dimension(), lwe_dimension);

engine.destroy(key)?;
engine.destroy(plaintext)?;
engine.destroy(ciphertext)?;

Unsafely decrypts an LWE ciphertext. Read more

Description:

Implementation of LweCiphertextDiscardingEncryptionEngine for CoreEngine that operates on 64 bits integers.

Example:
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::LweDimension;
use concrete_core::prelude::*;

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(2);
// Here a hard-set encoding is applied (shift by 50 bits)
let input = 3_u64 << 50;
let noise = Variance(2_f64.powf(-25.));

let mut engine = CoreEngine::new()?;
let key: LweSecretKey64 = engine.create_lwe_secret_key(lwe_dimension)?;
let plaintext = engine.create_plaintext(&input)?;
let mut ciphertext = engine.encrypt_lwe_ciphertext(&key, &plaintext, noise)?;

engine.discard_encrypt_lwe_ciphertext(&key, &mut ciphertext, &plaintext, noise)?;
assert_eq!(ciphertext.lwe_dimension(), lwe_dimension);

engine.destroy(key)?;
engine.destroy(plaintext)?;
engine.destroy(ciphertext)?;

Unsafely encrypts an LWE ciphertext. Read more

Description:

Implementation of LweCiphertextDiscardingExtractionEngine for CoreEngine that operates on 64 bits integers.

Example:
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::{
    GlweDimension, LweDimension, MonomialIndex, PolynomialSize,
};
use concrete_core::prelude::*;

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
// The target LWE dimension should be equal to the polynomial size + 1
// since we're going to extract one sample from the GLWE ciphertext
let lwe_dimension = LweDimension(8);
let glwe_dimension = GlweDimension(2);
let polynomial_size = PolynomialSize(4);
// There are always polynomial_size messages encrypted in the GLWE ciphertext
// We're going to extract the first one
// Here a hard-set encoding is applied (shift by 50 bits)
let input = vec![3_u64 << 50; polynomial_size.0];
let noise = Variance(2_f64.powf(-25.));

let mut engine = CoreEngine::new()?;
let glwe_key: GlweSecretKey64 =
    engine.create_glwe_secret_key(glwe_dimension, polynomial_size)?;
let lwe_key: LweSecretKey64 = engine.create_lwe_secret_key(lwe_dimension)?;
let plaintext_vector = engine.create_plaintext_vector(&input)?;
let glwe_ciphertext = engine.encrypt_glwe_ciphertext(&glwe_key, &plaintext_vector, noise)?;
// We first create an LWE ciphertext encrypting zeros
let mut lwe_ciphertext = engine.zero_encrypt_lwe_ciphertext(&lwe_key, noise)?;

// Then we extract the first sample from the GLWE ciphertext to store it into the LWE
engine.discard_extract_lwe_ciphertext(
    &mut lwe_ciphertext,
    &glwe_ciphertext,
    MonomialIndex(0),
)?;
assert_eq!(lwe_ciphertext.lwe_dimension(), lwe_dimension);

engine.destroy(glwe_key)?;
engine.destroy(lwe_key)?;
engine.destroy(plaintext_vector)?;
engine.destroy(glwe_ciphertext)?;
engine.destroy(lwe_ciphertext)?;

Unsafely extracts an LWE ciphertext from a GLWE ciphertext. Read more

Description:

Implementation of LweCiphertextDiscardingKeyswitchEngine for CoreEngine that operates on 64 bits integers.

Example:
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::{
    DecompositionBaseLog, DecompositionLevelCount, LweDimension,
};
use concrete_core::prelude::*;

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let input_lwe_dimension = LweDimension(6);
let output_lwe_dimension = LweDimension(3);
let decomposition_level_count = DecompositionLevelCount(2);
let decomposition_base_log = DecompositionBaseLog(8);
let noise = Variance(2_f64.powf(-25.));
// Here a hard-set encoding is applied (shift by 50 bits)
let input = 3_u64 << 50;

let mut engine = CoreEngine::new()?;
let input_key: LweSecretKey64 = engine.create_lwe_secret_key(input_lwe_dimension)?;
let output_key: LweSecretKey64 = engine.create_lwe_secret_key(output_lwe_dimension)?;
let keyswitch_key = engine.create_lwe_keyswitch_key(
    &input_key,
    &output_key,
    decomposition_level_count,
    decomposition_base_log,
    noise,
)?;
let plaintext = engine.create_plaintext(&input)?;
let ciphertext_1 = engine.encrypt_lwe_ciphertext(&input_key, &plaintext, noise)?;
let mut ciphertext_2 = engine.zero_encrypt_lwe_ciphertext(&output_key, noise)?;

engine.discard_keyswitch_lwe_ciphertext(&mut ciphertext_2, &ciphertext_1, &keyswitch_key)?;
assert_eq!(ciphertext_2.lwe_dimension(), output_lwe_dimension);

engine.destroy(input_key)?;
engine.destroy(output_key)?;
engine.destroy(keyswitch_key)?;
engine.destroy(plaintext)?;
engine.destroy(ciphertext_1)?;
engine.destroy(ciphertext_2)?;

Unsafely keyswitch an LWE ciphertext. Read more

Description:

Implementation of LweCiphertextDiscardingNegationEngine for CoreEngine that operates on 64 bits integers.

Example:
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::LweDimension;
use concrete_core::prelude::*;

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(2);
// Here a hard-set encoding is applied (shift by 50 bits)
let input = 3_u64 << 50;
let noise = Variance(2_f64.powf(-25.));

let mut engine = CoreEngine::new()?;
let key: LweSecretKey64 = engine.create_lwe_secret_key(lwe_dimension)?;
let plaintext = engine.create_plaintext(&input)?;
let ciphertext_1 = engine.encrypt_lwe_ciphertext(&key, &plaintext, noise)?;
let mut ciphertext_2 = engine.zero_encrypt_lwe_ciphertext(&key, noise)?;

engine.discard_neg_lwe_ciphertext(&mut ciphertext_2, &ciphertext_1)?;
assert_eq!(ciphertext_2.lwe_dimension(), lwe_dimension);

engine.destroy(key)?;
engine.destroy(plaintext)?;
engine.destroy(ciphertext_1)?;
engine.destroy(ciphertext_2)?;

Unsafely negates an LWE ciphertext. Read more

Description:

Implementation of LweCiphertextEncryptionEngine for CoreEngine that operates on 64 bits integers.

Example:
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::LweDimension;
use concrete_core::prelude::*;

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(2);
// Here a hard-set encoding is applied (shift by 50 bits)
let input = 3_u64 << 50;
let noise = Variance(2_f64.powf(-25.));

let mut engine = CoreEngine::new()?;
let key: LweSecretKey64 = engine.create_lwe_secret_key(lwe_dimension)?;
let plaintext = engine.create_plaintext(&input)?;

let ciphertext = engine.encrypt_lwe_ciphertext(&key, &plaintext, noise)?;
assert_eq!(ciphertext.lwe_dimension(), lwe_dimension);

engine.destroy(key)?;
engine.destroy(plaintext)?;
engine.destroy(ciphertext)?;

Unsafely encrypts an LWE ciphertext. Read more

The distribution of the key the ciphertext was encrypted with.

Returns the LWE dimension of the ciphertext.

Description:

Implementation of LweCiphertextFusingAdditionEngine for CoreEngine that operates on 64 bits integers.

Example:
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::LweDimension;
use concrete_core::prelude::*;

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(2);
// Here a hard-set encoding is applied (shift by 50 bits)
let input_1 = 3_u64 << 50;
let input_2 = 5_u64 << 50;
let noise = Variance(2_f64.powf(-25.));

let mut engine = CoreEngine::new()?;
let key: LweSecretKey64 = engine.create_lwe_secret_key(lwe_dimension)?;
let plaintext_1 = engine.create_plaintext(&input_1)?;
let plaintext_2 = engine.create_plaintext(&input_2)?;
let ciphertext_1 = engine.encrypt_lwe_ciphertext(&key, &plaintext_1, noise)?;
let mut ciphertext_2 = engine.encrypt_lwe_ciphertext(&key, &plaintext_2, noise)?;

engine.fuse_add_lwe_ciphertext(&mut ciphertext_2, &ciphertext_1)?;
assert_eq!(ciphertext_2.lwe_dimension(), lwe_dimension);

engine.destroy(key)?;
engine.destroy(plaintext_1)?;
engine.destroy(ciphertext_1)?;
engine.destroy(plaintext_2)?;
engine.destroy(ciphertext_2)?;

Unsafely add an LWE ciphertext to an other. Read more

Description:

Implementation of LweCiphertextFusingNegationEngine for CoreEngine that operates on 64 bits integers.

Example:
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::LweDimension;
use concrete_core::prelude::*;

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(2);
// Here a hard-set encoding is applied (shift by 50 bits)
let input = 3_u64 << 50;
let noise = Variance(2_f64.powf(-25.));

let mut engine = CoreEngine::new()?;
let key: LweSecretKey64 = engine.create_lwe_secret_key(lwe_dimension)?;
let plaintext = engine.create_plaintext(&input)?;
let mut ciphertext = engine.encrypt_lwe_ciphertext(&key, &plaintext, noise)?;

engine.fuse_neg_lwe_ciphertext(&mut ciphertext)?;
assert_eq!(ciphertext.lwe_dimension(), lwe_dimension);

engine.destroy(key)?;
engine.destroy(plaintext)?;
engine.destroy(ciphertext)?;

Unsafely negates an LWE ciphertext. Read more

Description:

Implementation of LweCiphertextPlaintextDiscardingAdditionEngine for CoreEngine that operates on 64 bits integers.

Example:
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::LweDimension;
use concrete_core::prelude::*;

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(2);
// Here a hard-set encoding is applied (shift by 50 bits)
let input = 3_u64 << 50;
let noise = Variance(2_f64.powf(-25.));

let mut engine = CoreEngine::new()?;
let key: LweSecretKey64 = engine.create_lwe_secret_key(lwe_dimension)?;
let plaintext = engine.create_plaintext(&input)?;
let ciphertext_1 = engine.encrypt_lwe_ciphertext(&key, &plaintext, noise)?;
let mut ciphertext_2 = engine.zero_encrypt_lwe_ciphertext(&key, noise)?;

engine.discard_add_lwe_ciphertext_plaintext(&mut ciphertext_2, &ciphertext_1, &plaintext)?;
assert_eq!(ciphertext_2.lwe_dimension(), lwe_dimension);

engine.destroy(key)?;
engine.destroy(plaintext)?;
engine.destroy(ciphertext_1)?;
engine.destroy(ciphertext_2)?;

Unsafely adds a plaintext to an LWE ciphertext. Read more

Description:

Implementation of LweCiphertextPlaintextFusingAdditionEngine for CoreEngine that operates on 64 bits integers.

Example:
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::LweDimension;
use concrete_core::prelude::*;

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(2);
// Here a hard-set encoding is applied (shift by 40 bits)
let input_1 = 3_u64 << 40;
let input_2 = 5_u64 << 40;
let noise = Variance(2_f64.powf(-25.));

let mut engine = CoreEngine::new()?;
let key: LweSecretKey64 = engine.create_lwe_secret_key(lwe_dimension)?;
let plaintext_1 = engine.create_plaintext(&input_1)?;
let plaintext_2 = engine.create_plaintext(&input_2)?;
let mut ciphertext = engine.encrypt_lwe_ciphertext(&key, &plaintext_1, noise)?;

engine.fuse_add_lwe_ciphertext_plaintext(&mut ciphertext, &plaintext_2)?;
assert_eq!(ciphertext.lwe_dimension(), lwe_dimension);

engine.destroy(key)?;
engine.destroy(plaintext_1)?;
engine.destroy(plaintext_2)?;
engine.destroy(ciphertext)?;

Unsafely add a plaintext to an LWE ciphertext. Read more

Example:

use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::{CiphertextCount, LweSize};
use concrete_core::prelude::*;

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_size = LweSize(10);
let input = 3_u64 << 20;
let noise = Variance(2_f64.powf(-25.));

let mut engine = CoreEngine::new()?;
let plaintext: Plaintext64 = engine.create_plaintext(&input)?;
let ciphertext: LweCiphertext64 =
    engine.trivially_encrypt_lwe_ciphertext(lwe_size, &plaintext)?;

assert_eq!(ciphertext.lwe_dimension().to_lwe_size(), lwe_size);

engine.destroy(plaintext)?;
engine.destroy(ciphertext)?;

Unsafely creates the trivial LWE encryption of the plaintext. Read more

Description:

Implementation of LweCiphertextVectorDiscardingAffineTransformationEngine for CoreEngine that operates on 64 bits integers.

Example:
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::LweDimension;
use concrete_core::prelude::*;

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(2);
// Here a hard-set encoding is applied (shift by 20 bits)
let input_vector = vec![3_u64 << 50; 8];
let weights_input = vec![2_u64; 8];
let bias_input = 8_u64 << 50;
let noise = Variance::from_variance(2_f64.powf(-25.));

let mut engine = CoreEngine::new()?;
let key: LweSecretKey64 = engine.create_lwe_secret_key(lwe_dimension)?;
let weights: CleartextVector64 = engine.create_cleartext_vector(&input_vector)?;
let bias: Plaintext64 = engine.create_plaintext(&bias_input)?;
let plaintext_vector: PlaintextVector64 = engine.create_plaintext_vector(&input_vector)?;
let ciphertext_vector = engine.encrypt_lwe_ciphertext_vector(&key, &plaintext_vector, noise)?;
let mut output_ciphertext = engine.zero_encrypt_lwe_ciphertext(&key, noise)?;

engine.discard_affine_transform_lwe_ciphertext_vector(
    &mut output_ciphertext,
    &ciphertext_vector,
    &weights,
    &bias,
)?;
assert_eq!(output_ciphertext.lwe_dimension(), lwe_dimension);

engine.destroy(key)?;
engine.destroy(weights)?;
engine.destroy(bias)?;
engine.destroy(plaintext_vector)?;
engine.destroy(ciphertext_vector)?;
engine.destroy(output_ciphertext)?;

Unsafely performs the affine transform of an LWE ciphertext vector. Read more

Description:

Implementation of LweCiphertextZeroEncryptionEngine for CoreEngine that operates on 64 bits integers.

Example:
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::LweDimension;
use concrete_core::prelude::*;

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(2);
let noise = Variance(2_f64.powf(-25.));

let mut engine = CoreEngine::new()?;
let key: LweSecretKey64 = engine.create_lwe_secret_key(lwe_dimension)?;

let ciphertext = engine.zero_encrypt_lwe_ciphertext(&key, noise)?;
assert_eq!(ciphertext.lwe_dimension(), lwe_dimension);

engine.destroy(key)?;
engine.destroy(ciphertext)?;

Safely encrypts zero into an LWE ciphertext. Read more

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

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

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

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.