Struct concrete_core::backends::default::entities::LweSeededCiphertextVector64
source · [−]pub struct LweSeededCiphertextVector64(_);
Expand description
A structure representing a vector of seeded LWE ciphertexts with 64 bits of precision.
Trait Implementations
sourceimpl AbstractEntity for LweSeededCiphertextVector64
impl AbstractEntity for LweSeededCiphertextVector64
type Kind = LweSeededCiphertextVectorKind
type Kind = LweSeededCiphertextVectorKind
The kind of the entity.
sourceimpl Clone for LweSeededCiphertextVector64
impl Clone for LweSeededCiphertextVector64
sourcefn clone(&self) -> LweSeededCiphertextVector64
fn clone(&self) -> LweSeededCiphertextVector64
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 LweSeededCiphertextVector64
impl Debug for LweSeededCiphertextVector64
sourceimpl DestructionEngine<LweSeededCiphertextVector64> for DefaultEngine
impl DestructionEngine<LweSeededCiphertextVector64> for DefaultEngine
sourcefn destroy(
&mut self,
entity: LweSeededCiphertextVector64
) -> Result<(), DestructionError<Self::EngineError>>
fn destroy(
&mut self,
entity: LweSeededCiphertextVector64
) -> Result<(), DestructionError<Self::EngineError>>
Destroys an entity.
sourceunsafe fn destroy_unchecked(&mut self, _entity: &mut LweSeededCiphertextVector64)
unsafe fn destroy_unchecked(&mut self, _entity: &mut LweSeededCiphertextVector64)
Unsafely destroys an entity. Read more
sourceimpl LweSeededCiphertextVectorEncryptionEngine<LweSecretKey64, PlaintextVector64, LweSeededCiphertextVector64> for DefaultEngine
impl LweSeededCiphertextVectorEncryptionEngine<LweSecretKey64, PlaintextVector64, LweSeededCiphertextVector64> for DefaultEngine
Description:
Implementation of LweSeededCiphertextVectorEncryptionEngine
for DefaultEngine
that
operates on 64 bits integers.
sourcefn encrypt_lwe_seeded_ciphertext_vector(
&mut self,
key: &LweSecretKey64,
input: &PlaintextVector64,
noise: Variance
) -> Result<LweSeededCiphertextVector64, LweSeededCiphertextVectorEncryptionError<Self::EngineError>>
fn encrypt_lwe_seeded_ciphertext_vector(
&mut self,
key: &LweSecretKey64,
input: &PlaintextVector64,
noise: Variance
) -> Result<LweSeededCiphertextVector64, LweSeededCiphertextVectorEncryptionError<Self::EngineError>>
Example:
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::{LweCiphertextCount, LweDimension};
use concrete_core::prelude::*;
// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(6);
// Here a hard-set encoding is applied (shift by 50 bits)
let input = vec![3_u64 << 50; 3];
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 key: LweSecretKey64 = engine.create_lwe_secret_key(lwe_dimension)?;
let plaintext_vector: PlaintextVector64 = engine.create_plaintext_vector(&input)?;
let mut ciphertext_vector: LweSeededCiphertextVector64 =
engine.encrypt_lwe_seeded_ciphertext_vector(&key, &plaintext_vector, noise)?;
assert_eq!(ciphertext_vector.lwe_dimension(), lwe_dimension);
assert_eq!(
engine.destroy(key)?;
engine.destroy(plaintext_vector)?;
engine.destroy(ciphertext_vector)?;
sourceunsafe fn encrypt_lwe_seeded_ciphertext_vector_unchecked(
&mut self,
key: &LweSecretKey64,
input: &PlaintextVector64,
noise: Variance
) -> LweSeededCiphertextVector64
unsafe fn encrypt_lwe_seeded_ciphertext_vector_unchecked(
&mut self,
key: &LweSecretKey64,
input: &PlaintextVector64,
noise: Variance
) -> LweSeededCiphertextVector64
Unsafely encrypts a seeded LWE ciphertext vector. Read more
sourceimpl LweSeededCiphertextVectorEntity for LweSeededCiphertextVector64
impl LweSeededCiphertextVectorEntity for LweSeededCiphertextVector64
type KeyDistribution = BinaryKeyDistribution
type KeyDistribution = BinaryKeyDistribution
The distribution of key the ciphertext was encrypted with.
sourcefn lwe_dimension(&self) -> LweDimension
fn lwe_dimension(&self) -> LweDimension
Returns the LWE dimension of the ciphertexts.
sourcefn lwe_ciphertext_count(&self) -> LweCiphertextCount
fn lwe_ciphertext_count(&self) -> LweCiphertextCount
Returns the number of ciphertexts contained in the vector.
sourcefn compression_seed(&self) -> CompressionSeed
fn compression_seed(&self) -> CompressionSeed
Returns the seed used to compress the LWE ciphertexts.
sourceimpl LweSeededCiphertextVectorToLweCiphertextVectorTransformationEngine<LweSeededCiphertextVector64, LweCiphertextVector64> for DefaultEngine
impl LweSeededCiphertextVectorToLweCiphertextVectorTransformationEngine<LweSeededCiphertextVector64, LweCiphertextVector64> for DefaultEngine
Description:
Implementation of LweSeededCiphertextVectorToLweCiphertextVectorTransformationEngine
for
DefaultEngine
that operates on 64 bits integers.
sourcefn transform_lwe_seeded_ciphertext_vector_to_lwe_ciphertext_vector(
&mut self,
lwe_seeded_ciphertext_vector: LweSeededCiphertextVector64
) -> Result<LweCiphertextVector64, LweSeededCiphertextVectorToLweCiphertextVectorTransformationEngineError<Self::EngineError>>
fn transform_lwe_seeded_ciphertext_vector_to_lwe_ciphertext_vector(
&mut self,
lwe_seeded_ciphertext_vector: LweSeededCiphertextVector64
) -> Result<LweCiphertextVector64, LweSeededCiphertextVectorToLweCiphertextVectorTransformationEngineError<Self::EngineError>>
Example:
use concrete_commons::dispersion::Variance;
use concrete_commons::parameters::{LweCiphertextCount, LweDimension};
use concrete_core::prelude::*;
// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(6);
// Here a hard-set encoding is applied (shift by 50 bits)
let input = vec![3_u64 << 50; 3];
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 key: LweSecretKey64 = engine.create_lwe_secret_key(lwe_dimension)?;
let plaintext_vector: PlaintextVector64 = engine.create_plaintext_vector(&input)?;
let mut seeded_ciphertext_vector: LweSeededCiphertextVector64 =
engine.encrypt_lwe_seeded_ciphertext_vector(&key, &plaintext_vector, noise)?;
let ciphertext_vector = engine
.transform_lwe_seeded_ciphertext_vector_to_lwe_ciphertext_vector(
seeded_ciphertext_vector,
)?;
assert_eq!(ciphertext_vector.lwe_dimension(), lwe_dimension);
engine.destroy(key)?;
engine.destroy(plaintext_vector)?;
engine.destroy(ciphertext_vector)?;
sourceunsafe fn transform_lwe_seeded_ciphertext_vector_to_lwe_ciphertext_vector_unchecked(
&mut self,
lwe_seeded_ciphertext_vector: LweSeededCiphertextVector64
) -> LweCiphertextVector64
unsafe fn transform_lwe_seeded_ciphertext_vector_to_lwe_ciphertext_vector_unchecked(
&mut self,
lwe_seeded_ciphertext_vector: LweSeededCiphertextVector64
) -> LweCiphertextVector64
Unsafely transforms an LWE seeded ciphertext vector into an LWE ciphertext vector Read more
sourceimpl PartialEq<LweSeededCiphertextVector64> for LweSeededCiphertextVector64
impl PartialEq<LweSeededCiphertextVector64> for LweSeededCiphertextVector64
sourcefn eq(&self, other: &LweSeededCiphertextVector64) -> bool
fn eq(&self, other: &LweSeededCiphertextVector64) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &LweSeededCiphertextVector64) -> bool
fn ne(&self, other: &LweSeededCiphertextVector64) -> bool
This method tests for !=
.
impl Eq for LweSeededCiphertextVector64
impl StructuralEq for LweSeededCiphertextVector64
impl StructuralPartialEq for LweSeededCiphertextVector64
Auto Trait Implementations
impl RefUnwindSafe for LweSeededCiphertextVector64
impl Send for LweSeededCiphertextVector64
impl Sync for LweSeededCiphertextVector64
impl Unpin for LweSeededCiphertextVector64
impl UnwindSafe for LweSeededCiphertextVector64
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