Trait tfhe::prelude::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>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl FheTryEncrypt<bool, ClientKey> for CompressedFheBool

§

type Error = Error

source§

impl FheTryEncrypt<bool, ClientKey> for FheBool

§

type Error = Error

source§

impl FheTryEncrypt<bool, CompactPublicKey> for CompactFheBool

§

type Error = Error

source§

impl FheTryEncrypt<bool, CompactPublicKey> for FheBool

§

type Error = Error

source§

impl FheTryEncrypt<bool, CompressedPublicKey> for FheBool

§

type Error = Error

source§

impl FheTryEncrypt<bool, PublicKey> for FheBool

§

type Error = Error

source§

impl<'a> FheTryEncrypt<&'a [bool], CompactPublicKey> for CompactFheBoolList

§

type Error = Error

source§

impl<'a, Id, T> FheTryEncrypt<&'a [T], CompactPublicKey> for CompactFheIntList<Id>
where T: DecomposableInto<u64>, Id: FheIntId,

§

type Error = Error

source§

impl<'a, Id, T> FheTryEncrypt<&'a [T], CompactPublicKey> for CompactFheUintList<Id>
where T: DecomposableInto<u64>, Id: FheUintId,

§

type Error = Error

source§

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

§

type Error = Error

source§

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

§

type Error = Error

source§

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

§

type Error = Error

source§

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

§

type Error = Error

source§

impl<Id, T> FheTryEncrypt<T, CompactPublicKey> for CompactFheInt<Id>
where T: DecomposableInto<u64>, Id: FheIntId,

§

type Error = Error

source§

impl<Id, T> FheTryEncrypt<T, CompactPublicKey> for CompactFheUint<Id>
where T: DecomposableInto<u64>, Id: FheUintId,

§

type Error = Error

source§

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

§

type Error = Error

source§

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

§

type Error = Error

source§

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

§

type Error = Error

source§

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

§

type Error = Error

source§

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

§

type Error = Error

source§

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

§

type Error = Error