pub struct FunctionalPackingKeyswitchKey64(pub FunctionalPackingKeyswitchKey<Vec<u64>>);Expand description
A structure representing a functional packing keyswitch key with 64 bits of precision.
Tuple Fields§
§0: FunctionalPackingKeyswitchKey<Vec<u64>>Trait Implementations§
Source§impl AbstractEntity for FunctionalPackingKeyswitchKey64
impl AbstractEntity for FunctionalPackingKeyswitchKey64
Source§type Kind = FunctionalPackingKeyswitchKeyKind
type Kind = FunctionalPackingKeyswitchKeyKind
The kind of the entity.
Source§impl Clone for FunctionalPackingKeyswitchKey64
impl Clone for FunctionalPackingKeyswitchKey64
Source§fn clone(&self) -> FunctionalPackingKeyswitchKey64
fn clone(&self) -> FunctionalPackingKeyswitchKey64
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl DestructionEngine<FunctionalPackingKeyswitchKey64> for CoreEngine
impl DestructionEngine<FunctionalPackingKeyswitchKey64> for CoreEngine
Source§fn destroy(
&mut self,
entity: FunctionalPackingKeyswitchKey64,
) -> Result<(), DestructionError<Self::EngineError>>
fn destroy( &mut self, entity: FunctionalPackingKeyswitchKey64, ) -> Result<(), DestructionError<Self::EngineError>>
Destroys an entity.
Source§unsafe fn destroy_unchecked(
&mut self,
entity: &mut FunctionalPackingKeyswitchKey64,
)
unsafe fn destroy_unchecked( &mut self, entity: &mut FunctionalPackingKeyswitchKey64, )
Unsafely destroys an entity. Read more
Source§impl FunctionalPackingKeyswitchKeyCreationEngine<LweSecretKey64, GlweSecretKey64, FunctionalPackingKeyswitchKey64, CleartextVector64, u64> for CoreEngine
§Description:
Implementation of FunctionalPackingKeyswitchKeyCreationEngine for CoreEngine that
operates on 64 bits integers.
impl FunctionalPackingKeyswitchKeyCreationEngine<LweSecretKey64, GlweSecretKey64, FunctionalPackingKeyswitchKey64, CleartextVector64, u64> for CoreEngine
§Description:
Implementation of FunctionalPackingKeyswitchKeyCreationEngine for CoreEngine that
operates on 64 bits integers.
Source§fn create_functional_packing_keyswitch_key<F: Fn(u64) -> u64>(
&mut self,
input_key: &LweSecretKey64,
output_key: &GlweSecretKey64,
decomposition_level_count: DecompositionLevelCount,
decomposition_base_log: DecompositionBaseLog,
noise: StandardDev,
f: F,
polynomial: &CleartextVector64,
) -> Result<FunctionalPackingKeyswitchKey64, FunctionalPackingKeyswitchKeyCreationError<Self::EngineError>>
fn create_functional_packing_keyswitch_key<F: Fn(u64) -> u64>( &mut self, input_key: &LweSecretKey64, output_key: &GlweSecretKey64, decomposition_level_count: DecompositionLevelCount, decomposition_base_log: DecompositionBaseLog, noise: StandardDev, f: F, polynomial: &CleartextVector64, ) -> Result<FunctionalPackingKeyswitchKey64, FunctionalPackingKeyswitchKeyCreationError<Self::EngineError>>
Creates a functional packing keyswitch key.
Source§unsafe fn create_functional_packing_keyswitch_key_unchecked<F: Fn(u64) -> u64>(
&mut self,
input_key: &LweSecretKey64,
output_key: &GlweSecretKey64,
decomposition_level_count: DecompositionLevelCount,
decomposition_base_log: DecompositionBaseLog,
noise: StandardDev,
f: F,
polynomial: &CleartextVector64,
) -> FunctionalPackingKeyswitchKey64
unsafe fn create_functional_packing_keyswitch_key_unchecked<F: Fn(u64) -> u64>( &mut self, input_key: &LweSecretKey64, output_key: &GlweSecretKey64, decomposition_level_count: DecompositionLevelCount, decomposition_base_log: DecompositionBaseLog, noise: StandardDev, f: F, polynomial: &CleartextVector64, ) -> FunctionalPackingKeyswitchKey64
Unsafely creates a functional packing keyswitch key. Read more
Source§impl FunctionalPackingKeyswitchKeyEntity for FunctionalPackingKeyswitchKey64
impl FunctionalPackingKeyswitchKeyEntity for FunctionalPackingKeyswitchKey64
Source§type InputKeyDistribution = BinaryKeyDistribution
type InputKeyDistribution = BinaryKeyDistribution
The distribution of the key the input ciphertext is encrypted with.
Source§type OutputKeyDistribution = BinaryKeyDistribution
type OutputKeyDistribution = BinaryKeyDistribution
The distribution of the key the output ciphertext is encrypted with.
Source§fn input_lwe_dimension(&self) -> LweDimension
fn input_lwe_dimension(&self) -> LweDimension
Returns the input LWE dimension of the key.
Source§fn output_glwe_dimension(&self) -> GlweDimension
fn output_glwe_dimension(&self) -> GlweDimension
Returns the output GLWE dimension of the key.
Source§fn output_polynomial_size(&self) -> PolynomialSize
fn output_polynomial_size(&self) -> PolynomialSize
Returns the output polynomial degree of the key.
Source§fn decomposition_level_count(&self) -> DecompositionLevelCount
fn decomposition_level_count(&self) -> DecompositionLevelCount
Returns the number of decomposition levels of the key.
Source§fn decomposition_base_log(&self) -> DecompositionBaseLog
fn decomposition_base_log(&self) -> DecompositionBaseLog
Returns the logarithm of the base used in the key.
Source§impl LweCiphertextVectorGlweCiphertextDiscardingFunctionalPackingKeyswitchEngine<FunctionalPackingKeyswitchKey64, LweCiphertextVector64, GlweCiphertext64> for CoreEngine
§Description:
Implementation of
LweCiphertextVectorGlweCiphertextDiscardingFunctionalPackingKeyswitchEngine
for
CoreEngine that operates on 64 bits integers.
impl LweCiphertextVectorGlweCiphertextDiscardingFunctionalPackingKeyswitchEngine<FunctionalPackingKeyswitchKey64, LweCiphertextVector64, GlweCiphertext64> for CoreEngine
§Description:
Implementation of
LweCiphertextVectorGlweCiphertextDiscardingFunctionalPackingKeyswitchEngine
for
CoreEngine that operates on 64 bits integers.
Source§fn discard_functional_packing_keyswitch_lwe_ciphertext_vector(
&mut self,
output: &mut GlweCiphertext64,
input: &LweCiphertextVector64,
ksk: &FunctionalPackingKeyswitchKey64,
) -> Result<(), LweCiphertextVectorGlweCiphertextDiscardingFunctionalPackingKeyswitchError<Self::EngineError>>
fn discard_functional_packing_keyswitch_lwe_ciphertext_vector( &mut self, output: &mut GlweCiphertext64, input: &LweCiphertextVector64, ksk: &FunctionalPackingKeyswitchKey64, ) -> Result<(), LweCiphertextVectorGlweCiphertextDiscardingFunctionalPackingKeyswitchError<Self::EngineError>>
§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_glwe_dimension = GlweDimension(3);
let decomposition_level_count = DecompositionLevelCount(2);
let decomposition_base_log = DecompositionBaseLog(8);
let polynomial_size = PolynomialSize(256);
let noise = Variance(2_f64.powf(-25.));
// Here a hard-set encoding is applied (shift by 50 bits)
let input_vector = vec![3_u64 << 50, 256];
let mut engine = CoreEngine::new(())?;
let input_key: LweSecretKey64 = engine.create_lwe_secret_key(input_lwe_dimension)?;
let output_key: GlweSecretKey64 =
engine.create_glwe_secret_key(output_glwe_dimension, polynomial_size)?;
let val = vec![1_u64; output_key.polynomial_size().0];
let polynomial: CleartextVector64 = engine.create_cleartext_vector(&val)?;
let functional_packing_keyswitch_key = engine.create_functional_packing_keyswitch_key(
&input_key,
&output_key,
decomposition_level_count,
decomposition_base_log,
noise,
|x|x,
&polynomial,
)?;
let plaintext_vector = engine.create_plaintext_vector(&input_vector)?;
let ciphertext_vector =
engine.encrypt_lwe_ciphertext_vector(&input_key, &plaintext_vector, noise)?;
let mut ciphertext_output = engine.zero_encrypt_glwe_ciphertext(&output_key, noise)?;
engine.discard_functional_packing_keyswitch_lwe_ciphertext_vector(
&mut ciphertext_output,
&ciphertext_vector,
&functional_packing_keyswitch_key,
)?;
assert_eq!(ciphertext_output.glwe_dimension(), output_glwe_dimension);
engine.destroy(input_key)?;
engine.destroy(output_key)?;
engine.destroy(functional_packing_keyswitch_key)?;
engine.destroy(plaintext_vector)?;
engine.destroy(ciphertext_vector)?;
engine.destroy(ciphertext_output)?;Source§unsafe fn discard_functional_packing_keyswitch_lwe_ciphertext_vector_unchecked(
&mut self,
output: &mut GlweCiphertext64,
input: &LweCiphertextVector64,
ksk: &FunctionalPackingKeyswitchKey64,
)
unsafe fn discard_functional_packing_keyswitch_lwe_ciphertext_vector_unchecked( &mut self, output: &mut GlweCiphertext64, input: &LweCiphertextVector64, ksk: &FunctionalPackingKeyswitchKey64, )
Unsafely functional packing keyswitches an LWE ciphertext vector. Read more
Source§impl PartialEq for FunctionalPackingKeyswitchKey64
impl PartialEq for FunctionalPackingKeyswitchKey64
Source§fn eq(&self, other: &FunctionalPackingKeyswitchKey64) -> bool
fn eq(&self, other: &FunctionalPackingKeyswitchKey64) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for FunctionalPackingKeyswitchKey64
Auto Trait Implementations§
impl Freeze for FunctionalPackingKeyswitchKey64
impl RefUnwindSafe for FunctionalPackingKeyswitchKey64
impl Send for FunctionalPackingKeyswitchKey64
impl Sync for FunctionalPackingKeyswitchKey64
impl Unpin for FunctionalPackingKeyswitchKey64
impl UnwindSafe for FunctionalPackingKeyswitchKey64
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
Mutably borrows from an owned value. Read more