LweCiphertextVector32

Struct LweCiphertextVector32 

Source
pub struct LweCiphertextVector32(/* private fields */);
Expand description

A structure representing a vector of LWE ciphertexts with 32 bits of precision.

Trait Implementations§

Source§

impl AbstractEntity for LweCiphertextVector32

Source§

type Kind = LweCiphertextVectorKind

The kind of the entity.
Source§

impl Clone for LweCiphertextVector32

Source§

fn clone(&self) -> LweCiphertextVector32

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LweCiphertextVector32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl EntityDeserializationEngine<&[u8], LweCiphertextVector32> for DefaultSerializationEngine

§Description:

Implementation of EntityDeserializationEngine for DefaultSerializationEngine that operates on 32 bits integers. It deserializes a LWE ciphertext vector entity.

Source§

fn deserialize( &mut self, serialized: &[u8], ) -> Result<LweCiphertextVector32, EntityDeserializationError<Self::EngineError>>

§Example:
use concrete_core::prelude::{LweCiphertextCount, LweDimension, Variance, *};

// 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 20 bits)
let input = vec![3_u32 << 20; 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: LweSecretKey32 = engine.generate_new_lwe_secret_key(lwe_dimension)?;
let plaintext_vector: PlaintextVector32 = engine.create_plaintext_vector_from(&input)?;

let mut ciphertext_vector: LweCiphertextVector32 =
    engine.encrypt_lwe_ciphertext_vector(&key, &plaintext_vector, noise)?;

let mut serialization_engine = DefaultSerializationEngine::new(())?;
let serialized = serialization_engine.serialize(&ciphertext_vector)?;
let recovered = serialization_engine.deserialize(serialized.as_slice())?;
assert_eq!(ciphertext_vector, recovered);
Source§

unsafe fn deserialize_unchecked( &mut self, serialized: &[u8], ) -> LweCiphertextVector32

Unsafely deserializes an entity. Read more
Source§

impl EntitySerializationEngine<LweCiphertextVector32, Vec<u8>> for DefaultSerializationEngine

§Description:

Implementation of EntitySerializationEngine for DefaultSerializationEngine that operates on 32 bits integers. It serializes a LWE ciphertext vector entity.

Source§

fn serialize( &mut self, entity: &LweCiphertextVector32, ) -> Result<Vec<u8>, EntitySerializationError<Self::EngineError>>

§Example:
use concrete_core::prelude::{LweCiphertextCount, LweDimension, Variance, *};

// 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 20 bits)
let input = vec![3_u32 << 20; 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: LweSecretKey32 = engine.generate_new_lwe_secret_key(lwe_dimension)?;
let plaintext_vector: PlaintextVector32 = engine.create_plaintext_vector_from(&input)?;

let mut ciphertext_vector: LweCiphertextVector32 =
    engine.encrypt_lwe_ciphertext_vector(&key, &plaintext_vector, noise)?;

let mut serialization_engine = DefaultSerializationEngine::new(())?;
let serialized = serialization_engine.serialize(&ciphertext_vector)?;
let recovered = serialization_engine.deserialize(serialized.as_slice())?;
assert_eq!(ciphertext_vector, recovered);
Source§

unsafe fn serialize_unchecked( &mut self, entity: &LweCiphertextVector32, ) -> Vec<u8>

Unsafely serializes an entity. Read more
Source§

impl LweCiphertextDiscardingBitExtractEngine<FftFourierLweBootstrapKey32, LweKeyswitchKey32, LweCiphertext32, LweCiphertextVector32> for FftEngine

§Description:

Implementation of LweCiphertextDiscardingBitExtractEngine for FftEngine that operates on 32 bits integers.

Source§

fn discard_extract_bits_lwe_ciphertext( &mut self, output: &mut LweCiphertextVector32, input: &LweCiphertext32, bsk: &FftFourierLweBootstrapKey32, ksk: &LweKeyswitchKey32, extracted_bits_count: ExtractedBitsCount, delta_log: DeltaLog, ) -> Result<(), LweCiphertextDiscardingBitExtractError<Self::EngineError>>

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

// Here a hard-set encoding is applied (shift by 20 bits)
let input = 3_u32 << 20;
// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let (lwe_dim, glwe_dim, poly_size) = (LweDimension(4), GlweDimension(1), PolynomialSize(512));
let (dec_lc, dec_bl) = (DecompositionLevelCount(3), DecompositionBaseLog(5));
let extracted_bits_count = ExtractedBitsCount(1);
let delta_log = DeltaLog(5);
let noise = Variance(2_f64.powf(-50.));
let large_lwe_dim = LweDimension(glwe_dim.0 * poly_size.0);

// Unix seeder must be given a secret input.
// Here we just give it 0, and rely on /dev/random only for tests.
const UNSAFE_SECRET: u128 = 0;
let mut default_engine = DefaultEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let mut fft_engine = FftEngine::new(())?;
let glwe_sk: GlweSecretKey32 =
    default_engine.generate_new_glwe_secret_key(glwe_dim, poly_size)?;
let input_lwe_sk: LweSecretKey32 =
    default_engine.transform_glwe_secret_key_to_lwe_secret_key(glwe_sk.clone())?;
let output_lwe_sk: LweSecretKey32 = default_engine.generate_new_lwe_secret_key(lwe_dim)?;
let bsk: LweBootstrapKey32 = default_engine.generate_new_lwe_bootstrap_key(
    &output_lwe_sk,
    &glwe_sk,
    dec_bl,
    dec_lc,
    noise,
)?;
let ksk: LweKeyswitchKey32 = default_engine.generate_new_lwe_keyswitch_key(
    &input_lwe_sk,
    &output_lwe_sk,
    dec_lc,
    dec_bl,
    noise,
)?;
let bsk: FftFourierLweBootstrapKey32 = fft_engine.convert_lwe_bootstrap_key(&bsk)?;
let plaintext = default_engine.create_plaintext_from(&input)?;
let input = default_engine.encrypt_lwe_ciphertext(&input_lwe_sk, &plaintext, noise)?;
let mut output = default_engine.zero_encrypt_lwe_ciphertext_vector(
    &output_lwe_sk,
    noise,
    LweCiphertextCount(extracted_bits_count.0),
)?;

fft_engine.discard_extract_bits_lwe_ciphertext(
    &mut output,
    &input,
    &bsk,
    &ksk,
    extracted_bits_count,
    delta_log,
)?;
assert_eq!(output.lwe_dimension(), lwe_dim);
assert_eq!(
    output.lwe_ciphertext_count(),
    LweCiphertextCount(extracted_bits_count.0)
);
Source§

unsafe fn discard_extract_bits_lwe_ciphertext_unchecked( &mut self, output: &mut LweCiphertextVector32, input: &LweCiphertext32, bsk: &FftFourierLweBootstrapKey32, ksk: &LweKeyswitchKey32, extracted_bits_count: ExtractedBitsCount, delta_log: DeltaLog, )

Unsafely extract bits of an LWE ciphertext. Read more
Source§

impl LweCiphertextVectorConsumingRetrievalEngine<LweCiphertextVector32, Vec<u32>> for DefaultEngine

§Description:

Implementation of LweCiphertextVectorConsumingRetrievalEngine for DefaultEngine that returns the underlying slice of a LweCiphertextVector32 consuming it in the process

Source§

fn consume_retrieve_lwe_ciphertext_vector( &mut self, ciphertext: LweCiphertextVector32, ) -> Result<Vec<u32>, LweCiphertextVectorConsumingRetrievalError<Self::EngineError>>

§Example:
use concrete_core::prelude::{LweSize, *};

// Here we create a container outside of the engine
// Note that the size here is just for demonstration purposes and should not be chosen
// without proper security analysis for production
use concrete_core::commons::crypto::lwe::LweCiphertext;
let lwe_size = LweSize(128);
let lwe_count = LweCiphertextCount(8);
let mut owned_container = vec![0_u32; lwe_size.0 * lwe_count.0];
let original_vec_ptr = owned_container.as_ptr();

// 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 ciphertext_vector: LweCiphertextVector32 =
    engine.create_lwe_ciphertext_vector_from(owned_container, lwe_size)?;
let retrieved_container = engine.consume_retrieve_lwe_ciphertext_vector(ciphertext_vector)?;
assert_eq!(original_vec_ptr, retrieved_container.as_ptr());
Source§

unsafe fn consume_retrieve_lwe_ciphertext_vector_unchecked( &mut self, ciphertext: LweCiphertextVector32, ) -> Vec<u32>

Unsafely retrieves the content of the container from an LWE ciphertext vector, consuming it in the process. Read more
Source§

impl LweCiphertextVectorCreationEngine<Vec<u32>, LweCiphertextVector32> for DefaultEngine

§Description:

Implementation of LweCiphertextVectorCreationEngine for DefaultEngine which returns a LweCiphertextVector32.

Source§

fn create_lwe_ciphertext_vector_from( &mut self, container: Vec<u32>, lwe_size: LweSize, ) -> Result<LweCiphertextVector32, LweCiphertextVectorCreationError<Self::EngineError>>

§Example:
use concrete_core::prelude::*;

// Here we create a container outside of the engine
// Note that the size here is just for demonstration purposes and should not be chosen
// without proper security analysis for production
let lwe_size = LweSize(16);
let lwe_count = LweCiphertextCount(3);
let mut owned_container = vec![0_u32; lwe_size.0 * lwe_count.0];

// 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 ciphertext_vector: LweCiphertextVector32 =
    engine.create_lwe_ciphertext_vector_from(owned_container, lwe_size)?;
Source§

unsafe fn create_lwe_ciphertext_vector_from_unchecked( &mut self, container: Vec<u32>, lwe_size: LweSize, ) -> LweCiphertextVector32

Unsafely creates an LWE ciphertext vector from an arbitrary container. Read more
Source§

impl LweCiphertextVectorDecryptionEngine<LweSecretKey32, LweCiphertextVector32, PlaintextVector32> for DefaultEngine

§Description:

Implementation of LweCiphertextVectorDecryptionEngine for DefaultEngine that operates on 32 bits integers.

Source§

fn decrypt_lwe_ciphertext_vector( &mut self, key: &LweSecretKey32, input: &LweCiphertextVector32, ) -> Result<PlaintextVector32, LweCiphertextVectorDecryptionError<Self::EngineError>>

§Example:
use concrete_core::prelude::{LweCiphertextCount, LweDimension, PlaintextCount, Variance, *};

// 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 20 bits)
let input = vec![3_u32 << 20; 18];
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: LweSecretKey32 = engine.generate_new_lwe_secret_key(lwe_dimension)?;
let plaintext_vector: PlaintextVector32 = engine.create_plaintext_vector_from(&input)?;
let ciphertext_vector: LweCiphertextVector32 =
    engine.encrypt_lwe_ciphertext_vector(&key, &plaintext_vector, noise)?;

let decrypted_plaintext_vector =
    engine.decrypt_lwe_ciphertext_vector(&key, &ciphertext_vector)?;

assert_eq!(
    decrypted_plaintext_vector.plaintext_count(),
    PlaintextCount(18)
);
Source§

unsafe fn decrypt_lwe_ciphertext_vector_unchecked( &mut self, key: &LweSecretKey32, input: &LweCiphertextVector32, ) -> PlaintextVector32

Unsafely decrypts an LWE ciphertext vector. Read more
Source§

impl LweCiphertextVectorDiscardingAdditionEngine<LweCiphertextVector32, LweCiphertextVector32> for DefaultEngine

§Description:

Implementation of LweCiphertextVectorDiscardingAdditionEngine for DefaultEngine that operates on 32 bits integers.

Source§

fn discard_add_lwe_ciphertext_vector( &mut self, output: &mut LweCiphertextVector32, input_1: &LweCiphertextVector32, input_2: &LweCiphertextVector32, ) -> Result<(), LweCiphertextVectorDiscardingAdditionError<Self::EngineError>>

§Example:
use concrete_core::prelude::{LweDimension, Variance, *};

// 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_u32 << 20; 8];
let noise = Variance::from_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: LweSecretKey32 = engine.generate_new_lwe_secret_key(lwe_dimension)?;
let plaintext_vector: PlaintextVector32 = engine.create_plaintext_vector_from(&input_vector)?;
let ciphertext_vector = engine.encrypt_lwe_ciphertext_vector(&key, &plaintext_vector, noise)?;
let mut output_ciphertext_vector =
    engine.encrypt_lwe_ciphertext_vector(&key, &plaintext_vector, noise)?;

engine.discard_add_lwe_ciphertext_vector(
    &mut output_ciphertext_vector,
    &ciphertext_vector,
    &ciphertext_vector,
)?;
assert_eq!(output_ciphertext_vector.lwe_dimension(), lwe_dimension);
Source§

unsafe fn discard_add_lwe_ciphertext_vector_unchecked( &mut self, output: &mut LweCiphertextVector32, input_1: &LweCiphertextVector32, input_2: &LweCiphertextVector32, )

Unsafely adds two LWE ciphertext vectors. Read more
Source§

impl LweCiphertextVectorDiscardingAffineTransformationEngine<LweCiphertextVector32, CleartextVector32, Plaintext32, LweCiphertext32> for DefaultEngine

§Description:

Implementation of LweCiphertextVectorDiscardingAffineTransformationEngine for DefaultEngine that operates on 32 bits integers.

Source§

fn discard_affine_transform_lwe_ciphertext_vector( &mut self, output: &mut LweCiphertext32, inputs: &LweCiphertextVector32, weights: &CleartextVector32, bias: &Plaintext32, ) -> Result<(), LweCiphertextVectorDiscardingAffineTransformationError<Self::EngineError>>

§Example:
use concrete_core::prelude::{LweDimension, Variance, *};

// 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_u32 << 20; 8];
let weights_input = vec![2_u32; 8];
let bias_input = 8_u32 << 20;
let noise = Variance::from_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: LweSecretKey32 = engine.generate_new_lwe_secret_key(lwe_dimension)?;
let weights: CleartextVector32 = engine.create_cleartext_vector_from(&input_vector)?;
let bias: Plaintext32 = engine.create_plaintext_from(&bias_input)?;
let plaintext_vector: PlaintextVector32 = engine.create_plaintext_vector_from(&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);
Source§

unsafe fn discard_affine_transform_lwe_ciphertext_vector_unchecked( &mut self, output: &mut LweCiphertext32, inputs: &LweCiphertextVector32, weights: &CleartextVector32, bias: &Plaintext32, )

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

impl LweCiphertextVectorDiscardingDecryptionEngine<LweSecretKey32, LweCiphertextVector32, PlaintextVector32> for DefaultEngine

§Description:

Implementation of LweCiphertextVectorDiscardingDecryptionEngine for DefaultEngine that operates on 32 bits integers.

Source§

fn discard_decrypt_lwe_ciphertext_vector( &mut self, key: &LweSecretKey32, output: &mut PlaintextVector32, input: &LweCiphertextVector32, ) -> Result<(), LweCiphertextVectorDiscardingDecryptionError<Self::EngineError>>

§Example:
use concrete_core::prelude::{LweCiphertextCount, LweDimension, PlaintextCount, Variance, *};

// 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 20 bits)
let input = vec![3_u32 << 20; 18];
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: LweSecretKey32 = engine.generate_new_lwe_secret_key(lwe_dimension)?;
let mut plaintext_vector: PlaintextVector32 = engine.create_plaintext_vector_from(&input)?;
let ciphertext_vector: LweCiphertextVector32 =
    engine.encrypt_lwe_ciphertext_vector(&key, &plaintext_vector, noise)?;

engine.discard_decrypt_lwe_ciphertext_vector(
    &key,
    &mut plaintext_vector,
    &ciphertext_vector,
)?;
assert_eq!(plaintext_vector.plaintext_count(), PlaintextCount(18));
Source§

unsafe fn discard_decrypt_lwe_ciphertext_vector_unchecked( &mut self, key: &LweSecretKey32, output: &mut PlaintextVector32, input: &LweCiphertextVector32, )

Unsafely decrypts an LWE ciphertext vector. Read more
Source§

impl LweCiphertextVectorDiscardingEncryptionEngine<LweSecretKey32, PlaintextVector32, LweCiphertextVector32> for DefaultEngine

§Description:

Implementation of LweCiphertextVectorDiscardingEncryptionEngine for DefaultEngine that operates on 32 bits integers.

Source§

fn discard_encrypt_lwe_ciphertext_vector( &mut self, key: &LweSecretKey32, output: &mut LweCiphertextVector32, input: &PlaintextVector32, noise: Variance, ) -> Result<(), LweCiphertextVectorDiscardingEncryptionError<Self::EngineError>>

§Example:
use concrete_core::prelude::Variance;
use concrete_core::prelude::{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 20 bits)
let input = vec![3_u32 << 20; 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: LweSecretKey32 = engine.generate_new_lwe_secret_key(lwe_dimension)?;
let plaintext_vector: PlaintextVector32 = engine.create_plaintext_vector_from(&input)?;
let mut ciphertext_vector: LweCiphertextVector32 =
    engine.zero_encrypt_lwe_ciphertext_vector(&key, noise, LweCiphertextCount(3))?;

engine.discard_encrypt_lwe_ciphertext_vector(
    &key,
    &mut ciphertext_vector,
    &plaintext_vector,
    noise,
)?;
assert_eq!(ciphertext_vector.lwe_dimension(), lwe_dimension);
assert_eq!(
Source§

unsafe fn discard_encrypt_lwe_ciphertext_vector_unchecked( &mut self, key: &LweSecretKey32, output: &mut LweCiphertextVector32, input: &PlaintextVector32, noise: Variance, )

Unsafely encryprs an LWE ciphertext vector. Read more
Source§

impl LweCiphertextVectorDiscardingSubtractionEngine<LweCiphertextVector32, LweCiphertextVector32> for DefaultEngine

§Description:

Implementation of LweCiphertextVectorDiscardingSubtractionEngine for DefaultEngine that operates on 32 bits integers.

Source§

fn discard_sub_lwe_ciphertext_vector( &mut self, output: &mut LweCiphertextVector32, input_1: &LweCiphertextVector32, input_2: &LweCiphertextVector32, ) -> Result<(), LweCiphertextVectorDiscardingSubtractionError<Self::EngineError>>

§Example:
use concrete_core::prelude::{LweDimension, Variance, *};

// 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_u32 << 20; 8];
let noise = Variance::from_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: LweSecretKey32 = engine.generate_new_lwe_secret_key(lwe_dimension)?;
let plaintext_vector: PlaintextVector32 = engine.create_plaintext_vector_from(&input_vector)?;
let ciphertext_vector = engine.encrypt_lwe_ciphertext_vector(&key, &plaintext_vector, noise)?;
let mut output_ciphertext_vector =
    engine.encrypt_lwe_ciphertext_vector(&key, &plaintext_vector, noise)?;

engine.discard_sub_lwe_ciphertext_vector(
    &mut output_ciphertext_vector,
    &ciphertext_vector,
    &ciphertext_vector,
)?;
assert_eq!(output_ciphertext_vector.lwe_dimension(), lwe_dimension);
Source§

unsafe fn discard_sub_lwe_ciphertext_vector_unchecked( &mut self, output: &mut LweCiphertextVector32, input_1: &LweCiphertextVector32, input_2: &LweCiphertextVector32, )

Unsafely subtracts two LWE ciphertext vectors. Read more
Source§

impl LweCiphertextVectorEncryptionEngine<LweSecretKey32, PlaintextVector32, LweCiphertextVector32> for DefaultEngine

§Description:

Implementation of LweCiphertextVectorEncryptionEngine for DefaultEngine that operates on 32 bits integers.

Source§

fn encrypt_lwe_ciphertext_vector( &mut self, key: &LweSecretKey32, input: &PlaintextVector32, noise: Variance, ) -> Result<LweCiphertextVector32, LweCiphertextVectorEncryptionError<Self::EngineError>>

§Example:
use concrete_core::prelude::Variance;
use concrete_core::prelude::{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 20 bits)
let input = vec![3_u32 << 20; 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: LweSecretKey32 = engine.generate_new_lwe_secret_key(lwe_dimension)?;
let plaintext_vector: PlaintextVector32 = engine.create_plaintext_vector_from(&input)?;

let mut ciphertext_vector: LweCiphertextVector32 =
    engine.encrypt_lwe_ciphertext_vector(&key, &plaintext_vector, noise)?;
assert_eq!(ciphertext_vector.lwe_dimension(), lwe_dimension);
assert_eq!(
Source§

unsafe fn encrypt_lwe_ciphertext_vector_unchecked( &mut self, key: &LweSecretKey32, input: &PlaintextVector32, noise: Variance, ) -> LweCiphertextVector32

Unsafely encrypts an LWE ciphertext vector. Read more
Source§

impl LweCiphertextVectorEntity for LweCiphertextVector32

Source§

fn lwe_dimension(&self) -> LweDimension

Returns the LWE dimension of the ciphertexts.
Source§

fn lwe_ciphertext_count(&self) -> LweCiphertextCount

Returns the number of ciphertexts contained in the vector.
Source§

impl LweCiphertextVectorFusingAdditionEngine<LweCiphertextVector32, LweCiphertextVector32> for DefaultEngine

§Description:

Implementation of LweCiphertextVectorFusingAdditionEngine for DefaultEngine that operates on 32 bits integers.

Source§

fn fuse_add_lwe_ciphertext_vector( &mut self, output: &mut LweCiphertextVector32, input: &LweCiphertextVector32, ) -> Result<(), LweCiphertextVectorFusingAdditionError<Self::EngineError>>

§Example:
use concrete_core::prelude::{LweDimension, Variance, *};

// 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_u32 << 20; 8];
let noise = Variance::from_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: LweSecretKey32 = engine.generate_new_lwe_secret_key(lwe_dimension)?;
let plaintext_vector: PlaintextVector32 = engine.create_plaintext_vector_from(&input_vector)?;
let ciphertext_vector = engine.encrypt_lwe_ciphertext_vector(&key, &plaintext_vector, noise)?;
let mut output_ciphertext_vector =
    engine.encrypt_lwe_ciphertext_vector(&key, &plaintext_vector, noise)?;

engine.fuse_add_lwe_ciphertext_vector(&mut output_ciphertext_vector, &ciphertext_vector)?;
assert_eq!(output_ciphertext_vector.lwe_dimension(), lwe_dimension);
Source§

unsafe fn fuse_add_lwe_ciphertext_vector_unchecked( &mut self, output: &mut LweCiphertextVector32, input: &LweCiphertextVector32, )

Unsafely add two LWE ciphertext vectors. Read more
Source§

impl LweCiphertextVectorFusingSubtractionEngine<LweCiphertextVector32, LweCiphertextVector32> for DefaultEngine

§Description:

Implementation of LweCiphertextVectorFusingSubtractionEngine for DefaultEngine that operates on 32 bits integers.

Source§

fn fuse_sub_lwe_ciphertext_vector( &mut self, output: &mut LweCiphertextVector32, input: &LweCiphertextVector32, ) -> Result<(), LweCiphertextVectorFusingSubtractionError<Self::EngineError>>

§Example:
use concrete_core::prelude::{LweDimension, Variance, *};

// 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_u32 << 20; 8];
let noise = Variance::from_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: LweSecretKey32 = engine.generate_new_lwe_secret_key(lwe_dimension)?;
let plaintext_vector: PlaintextVector32 = engine.create_plaintext_vector_from(&input_vector)?;
let ciphertext_vector = engine.encrypt_lwe_ciphertext_vector(&key, &plaintext_vector, noise)?;
let mut output_ciphertext_vector =
    engine.encrypt_lwe_ciphertext_vector(&key, &plaintext_vector, noise)?;

engine.fuse_sub_lwe_ciphertext_vector(&mut output_ciphertext_vector, &ciphertext_vector)?;
assert_eq!(output_ciphertext_vector.lwe_dimension(), lwe_dimension);
Source§

unsafe fn fuse_sub_lwe_ciphertext_vector_unchecked( &mut self, output: &mut LweCiphertextVector32, input: &LweCiphertextVector32, )

Unsafely subtracts two LWE ciphertext vectors. Read more
Source§

impl LweCiphertextVectorGlweCiphertextDiscardingPackingKeyswitchEngine<LwePackingKeyswitchKey32, LweCiphertextVector32, GlweCiphertext32> for DefaultEngine

§Description:

Implementation of LweCiphertextVectorGlweCiphertextDiscardingPackingKeyswitchEngine for DefaultEngine that operates on 32 bits integers.

Source§

fn discard_packing_keyswitch_lwe_ciphertext_vector( &mut self, output: &mut GlweCiphertext32, input: &LweCiphertextVector32, ksk: &LwePackingKeyswitchKey32, ) -> Result<(), LweCiphertextVectorGlweCiphertextDiscardingPackingKeyswitchError<Self::EngineError>>

§Example:
use concrete_core::prelude::{
    DecompositionBaseLog, DecompositionLevelCount, LweDimension, Variance, *,
};

// 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 20 bits)
let input_vector = vec![3_u32 << 20, 256];

// 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 input_key: LweSecretKey32 = engine.generate_new_lwe_secret_key(input_lwe_dimension)?;
let output_key: GlweSecretKey32 =
    engine.generate_new_glwe_secret_key(output_glwe_dimension, polynomial_size)?;
let packing_keyswitch_key = engine.generate_new_lwe_packing_keyswitch_key(
    &input_key,
    &output_key,
    decomposition_level_count,
    decomposition_base_log,
    noise,
)?;
let plaintext_vector = engine.create_plaintext_vector_from(&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_packing_keyswitch_lwe_ciphertext_vector(
    &mut ciphertext_output,
    &ciphertext_vector,
    &packing_keyswitch_key,
)?;
assert_eq!(ciphertext_output.glwe_dimension(), output_glwe_dimension);
Source§

unsafe fn discard_packing_keyswitch_lwe_ciphertext_vector_unchecked( &mut self, output: &mut GlweCiphertext32, input: &LweCiphertextVector32, ksk: &LwePackingKeyswitchKey32, )

Unsafely packing keyswitches an LWE ciphertext vector. Read more
Source§

impl LweCiphertextVectorGlweCiphertextDiscardingPrivateFunctionalPackingKeyswitchEngine<LwePrivateFunctionalPackingKeyswitchKey32, LweCiphertextVector32, GlweCiphertext32> for DefaultEngine

§Description:

Implementation of LweCiphertextVectorGlweCiphertextDiscardingPrivateFunctionalPackingKeyswitchEngine for DefaultEngine that operates on 32 bits integers.

Source§

fn discard_private_functional_packing_keyswitch_lwe_ciphertext_vector( &mut self, output: &mut GlweCiphertext32, input: &LweCiphertextVector32, pfpksk: &LwePrivateFunctionalPackingKeyswitchKey32, ) -> Result<(), LweCiphertextVectorGlweCiphertextDiscardingPrivateFunctionalPackingKeyswitchError<Self::EngineError>>

§Example:
use concrete_core::prelude::{
    DecompositionBaseLog, DecompositionLevelCount, LweDimension, Variance, *,
};

// 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 20 bits)
let input_vector = vec![3_u32 << 20, 256];

// 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 input_key: LweSecretKey32 = engine.generate_new_lwe_secret_key(input_lwe_dimension)?;
let output_key: GlweSecretKey32 =
    engine.generate_new_glwe_secret_key(output_glwe_dimension, polynomial_size)?;
let val = vec![1_u32; output_key.polynomial_size().0];
let polynomial: CleartextVector32 = engine.create_cleartext_vector_from(&val)?;
let private_functional_packing_keyswitch_key = engine
    .generate_new_lwe_private_functional_packing_keyswitch_key(
        &input_key,
        &output_key,
        decomposition_level_count,
        decomposition_base_log,
        StandardDev(noise.get_standard_dev()),
        &|x| x,
        &polynomial,
    )?;
let plaintext_vector = engine.create_plaintext_vector_from(&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_private_functional_packing_keyswitch_lwe_ciphertext_vector(
    &mut ciphertext_output,
    &ciphertext_vector,
    &private_functional_packing_keyswitch_key,
)?;
assert_eq!(ciphertext_output.glwe_dimension(), output_glwe_dimension);
Source§

unsafe fn discard_private_functional_packing_keyswitch_lwe_ciphertext_vector_unchecked( &mut self, output: &mut GlweCiphertext32, input: &LweCiphertextVector32, pfpksk: &LwePrivateFunctionalPackingKeyswitchKey32, )

Unsafely keyswitches an LWE ciphertext vector using a private functional packing keyswitch key. Read more
Source§

impl LweCiphertextVectorTrivialDecryptionEngine<LweCiphertextVector32, PlaintextVector32> for DefaultEngine

Source§

fn trivially_decrypt_lwe_ciphertext_vector( &mut self, input: &LweCiphertextVector32, ) -> Result<PlaintextVector32, LweCiphertextVectorTrivialDecryptionError<Self::EngineError>>

§Example:

use concrete_core::prelude::{LweSize, Variance, *};

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_size = LweSize(10);
let input = vec![3_u32 << 20; 3];

// 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 plaintext_vector: PlaintextVector32 = engine.create_plaintext_vector_from(&input)?;
// DISCLAIMER: trivial encryption is NOT secure, and DOES NOT hide the message at all.
let ciphertext_vector: LweCiphertextVector32 =
    engine.trivially_encrypt_lwe_ciphertext_vector(lwe_size, &plaintext_vector)?;
let output: PlaintextVector32 =
    engine.trivially_decrypt_lwe_ciphertext_vector(&ciphertext_vector)?;

assert_eq!(output.plaintext_count(), PlaintextCount(3));
Source§

unsafe fn trivially_decrypt_lwe_ciphertext_vector_unchecked( &mut self, input: &LweCiphertextVector32, ) -> PlaintextVector32

Unsafely trivially decrypts an LWE ciphertext vector into a plaintext vector. Read more
Source§

impl LweCiphertextVectorTrivialEncryptionEngine<PlaintextVector32, LweCiphertextVector32> for DefaultEngine

Source§

fn trivially_encrypt_lwe_ciphertext_vector( &mut self, lwe_size: LweSize, input: &PlaintextVector32, ) -> Result<LweCiphertextVector32, LweCiphertextVectorTrivialEncryptionError<Self::EngineError>>

§Example:

use concrete_core::prelude::{LweSize, Variance, *};

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_size = LweSize(10);
let input = vec![3_u32 << 20; 3];

// 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 plaintext_vector: PlaintextVector32 = engine.create_plaintext_vector_from(&input)?;
// DISCLAIMER: trivial encryption is NOT secure, and DOES NOT hide the message at all.
let ciphertext_vector: LweCiphertextVector32 =
    engine.trivially_encrypt_lwe_ciphertext_vector(lwe_size, &plaintext_vector)?;

assert_eq!(ciphertext_vector.lwe_dimension().to_lwe_size(), lwe_size);
assert_eq!(
    ciphertext_vector.lwe_ciphertext_count().0,
    plaintext_vector.plaintext_count().0
);
Source§

unsafe fn trivially_encrypt_lwe_ciphertext_vector_unchecked( &mut self, lwe_size: LweSize, input: &PlaintextVector32, ) -> LweCiphertextVector32

Unsafely creates the trivial LWE encryption of the plaintext vector. Read more
Source§

impl LweCiphertextVectorZeroEncryptionEngine<LweSecretKey32, LweCiphertextVector32> for DefaultEngine

§Description:

Implementation of LweCiphertextVectorZeroEncryptionEngine for DefaultEngine that operates on 32 bits integers.

Source§

fn zero_encrypt_lwe_ciphertext_vector( &mut self, key: &LweSecretKey32, noise: Variance, count: LweCiphertextCount, ) -> Result<LweCiphertextVector32, LweCiphertextVectorZeroEncryptionError<Self::EngineError>>

§Example:
use concrete_core::prelude::{LweCiphertextCount, LweDimension, Variance, *};

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(2);
let ciphertext_count = LweCiphertextCount(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: LweSecretKey32 = engine.generate_new_lwe_secret_key(lwe_dimension)?;

let ciphertext_vector =
    engine.zero_encrypt_lwe_ciphertext_vector(&key, noise, ciphertext_count)?;
assert_eq!(ciphertext_vector.lwe_dimension(), lwe_dimension);
assert_eq!(ciphertext_vector.lwe_ciphertext_count(), ciphertext_count);
Source§

unsafe fn zero_encrypt_lwe_ciphertext_vector_unchecked( &mut self, key: &LweSecretKey32, noise: Variance, count: LweCiphertextCount, ) -> LweCiphertextVector32

Unsafely encrypts zeros in an LWE ciphertext vector. Read more
Source§

impl LweCiphertextVectorZeroEncryptionEngine<LweSecretKey32, LweCiphertextVector32> for DefaultParallelEngine

§Description:

Implementation of LweCiphertextVectorZeroEncryptionEngine for DefaultParallelEngine that operates on 32 bits integers.

Source§

fn zero_encrypt_lwe_ciphertext_vector( &mut self, key: &LweSecretKey32, noise: Variance, count: LweCiphertextCount, ) -> Result<LweCiphertextVector32, LweCiphertextVectorZeroEncryptionError<Self::EngineError>>

§Example:
use concrete_core::prelude::{LweCiphertextCount, LweDimension, Variance, *};

// DISCLAIMER: the parameters used here are only for test purpose, and are not secure.
let lwe_dimension = LweDimension(2);
let ciphertext_count = LweCiphertextCount(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 mut par_engine = DefaultParallelEngine::new(Box::new(UnixSeeder::new(UNSAFE_SECRET)))?;
let key: LweSecretKey32 = engine.generate_new_lwe_secret_key(lwe_dimension)?;

let ciphertext_vector =
    par_engine.zero_encrypt_lwe_ciphertext_vector(&key, noise, ciphertext_count)?;
assert_eq!(ciphertext_vector.lwe_dimension(), lwe_dimension);
assert_eq!(ciphertext_vector.lwe_ciphertext_count(), ciphertext_count);
Source§

unsafe fn zero_encrypt_lwe_ciphertext_vector_unchecked( &mut self, key: &LweSecretKey32, noise: Variance, count: LweCiphertextCount, ) -> LweCiphertextVector32

Unsafely encrypts zeros in an LWE ciphertext vector. Read more
Source§

impl LweSeededCiphertextVectorToLweCiphertextVectorTransformationEngine<LweSeededCiphertextVector32, LweCiphertextVector32> for DefaultEngine

§Description:

Implementation of LweSeededCiphertextVectorToLweCiphertextVectorTransformationEngine for DefaultEngine that operates on 32 bits integers.

Source§

fn transform_lwe_seeded_ciphertext_vector_to_lwe_ciphertext_vector( &mut self, lwe_seeded_ciphertext_vector: LweSeededCiphertextVector32, ) -> Result<LweCiphertextVector32, LweSeededCiphertextVectorToLweCiphertextVectorTransformationError<Self::EngineError>>

§Example:
use concrete_core::prelude::{LweCiphertextCount, LweDimension, Variance, *};

// 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 20 bits)
let input = vec![3_u32 << 20; 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: LweSecretKey32 = engine.generate_new_lwe_secret_key(lwe_dimension)?;
let plaintext_vector: PlaintextVector32 = engine.create_plaintext_vector_from(&input)?;

let mut seeded_ciphertext_vector: LweSeededCiphertextVector32 =
    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);
Source§

unsafe fn transform_lwe_seeded_ciphertext_vector_to_lwe_ciphertext_vector_unchecked( &mut self, lwe_seeded_ciphertext_vector: LweSeededCiphertextVector32, ) -> LweCiphertextVector32

Unsafely transforms an LWE seeded ciphertext vector into an LWE ciphertext vector Read more
Source§

impl PartialEq for LweCiphertextVector32

Source§

fn eq(&self, other: &LweCiphertextVector32) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for LweCiphertextVector32

Source§

impl StructuralPartialEq for LweCiphertextVector32

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.