Trait FheTryEncrypt

Source
pub trait FheTryEncrypt<T, Key>
where Self: Sized,
{ type Error: Error; // Required method fn try_encrypt(value: T, key: &Key) -> Result<Self, Self::Error>; }
Available on crate feature integer only.
Expand description

Trait used to have a generic fallible way of creating a value of a FHE type.

For example this trait may be implemented by FHE types which may not be able to represent all the values of even the smallest native type.

For example, FheUint2 which has 2 bits of precision may not be constructed from all values that a u8 can hold.

Required Associated Types§

Required Methods§

Source

fn try_encrypt(value: T, key: &Key) -> Result<Self, Self::Error>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl FheTryEncrypt<&str, ClientKey> for FheAsciiString

Available on crate feature strings only.
Source§

impl FheTryEncrypt<&String, ClientKey> for FheAsciiString

Available on crate feature strings only.
Source§

impl FheTryEncrypt<&[bool], ClientKey> for GpuFheBoolArray

Available on crate feature gpu only.
Source§

impl FheTryEncrypt<&[bool], ClientKey> for CpuFheBoolArray

Source§

impl FheTryEncrypt<bool, ClientKey> for CompressedFheBool

Source§

impl FheTryEncrypt<bool, ClientKey> for FheBool

Source§

impl FheTryEncrypt<bool, CompressedPublicKey> for FheBool

Source§

impl FheTryEncrypt<bool, PublicKey> for FheBool

Source§

impl<'a> FheTryEncrypt<&'a [bool], ClientKey> for FheBoolArray

Source§

impl<'a> FheTryEncrypt<EncryptableString<'a>, ClientKey> for FheAsciiString

Available on crate feature strings only.
Source§

impl<'a, Clear, Id> FheTryEncrypt<&'a [Clear], ClientKey> for FheArrayBase<Vec<RadixCiphertext>, Id>
where Id: FheUintId, Clear: DecomposableInto<u64> + UnsignedNumeric,

Source§

impl<'a, Clear, Id> FheTryEncrypt<&'a [Clear], ClientKey> for FheArrayBase<GpuOwned<CudaUnsignedRadixCiphertext>, Id>
where Id: FheUintId, Clear: DecomposableInto<u64> + UnsignedNumeric,

Available on crate feature gpu only.
Source§

impl<'a, Clear, Id> FheTryEncrypt<&'a [Clear], ClientKey> for FheArrayBase<InnerIntArray, Id>
where Id: FheIntId, Clear: DecomposableInto<u64> + SignedNumeric,

Source§

impl<'a, Clear, Id> FheTryEncrypt<&'a [Clear], ClientKey> for GpuFheIntArray<Id>
where Id: FheIntId, Clear: DecomposableInto<u64> + SignedNumeric,

Available on crate feature gpu only.
Source§

impl<'a, Clear, Id> FheTryEncrypt<&'a [Clear], ClientKey> for CpuFheIntArray<Id>
where Id: FheIntId, Clear: DecomposableInto<u64> + SignedNumeric,

Source§

impl<'a, Clear, Id> FheTryEncrypt<&'a [Clear], ClientKey> for FheUintArray<Id>
where Id: FheUintId, Clear: DecomposableInto<u64> + UnsignedNumeric,

Source§

impl<'a, Clear, Id> FheTryEncrypt<(&'a [Clear], Vec<usize>), ClientKey> for FheArrayBase<Vec<RadixCiphertext>, Id>
where Id: FheUintId, Clear: DecomposableInto<u64> + UnsignedNumeric,

Source§

impl<'a, Clear, Id> FheTryEncrypt<(&'a [Clear], Vec<usize>), ClientKey> for FheArrayBase<GpuOwned<CudaUnsignedRadixCiphertext>, Id>
where Id: FheUintId, Clear: DecomposableInto<u64> + UnsignedNumeric,

Available on crate feature gpu only.
Source§

impl<'a, Clear, Id> FheTryEncrypt<(&'a [Clear], Vec<usize>), ClientKey> for FheUintArray<Id>
where Id: FheUintId, Clear: DecomposableInto<u64> + UnsignedNumeric,

Source§

impl<Id, T> FheTryEncrypt<T, ClientKey> for CompressedFheInt<Id>
where Id: FheIntId, T: DecomposableInto<u64> + SignedNumeric,

Source§

impl<Id, T> FheTryEncrypt<T, ClientKey> for CompressedFheUint<Id>
where Id: FheUintId, T: DecomposableInto<u64> + UnsignedNumeric,

Source§

impl<Id, T> FheTryEncrypt<T, ClientKey> for FheInt<Id>
where Id: FheIntId, T: DecomposableInto<u64> + SignedNumeric,

Source§

impl<Id, T> FheTryEncrypt<T, ClientKey> for FheUint<Id>
where Id: FheUintId, T: DecomposableInto<u64> + UnsignedNumeric,

Source§

impl<Id, T> FheTryEncrypt<T, CompressedPublicKey> for FheInt<Id>
where Id: FheIntId, T: DecomposableInto<u64> + SignedNumeric,

Source§

impl<Id, T> FheTryEncrypt<T, CompressedPublicKey> for FheUint<Id>
where Id: FheUintId, T: DecomposableInto<u64> + UnsignedNumeric,

Source§

impl<Id, T> FheTryEncrypt<T, PublicKey> for FheInt<Id>
where Id: FheIntId, T: DecomposableInto<u64> + SignedNumeric,

Source§

impl<Id, T> FheTryEncrypt<T, PublicKey> for FheUint<Id>
where Id: FheUintId, T: DecomposableInto<u64> + UnsignedNumeric,