pub struct FheValue { /* private fields */ }Expand description
An encrypted value that supports homomorphic operations
Wrap plaintext with encrypt_* constructors, then use add/sub/mul,
comparison methods (eq/ne/lt/le/gt/ge), and boolean methods
(and/or/xor/not) — all without decrypting.
§Requirements
Before calling any operation, you must call [FheKeys::set_as_global_server_key].
The fhe feature must be enabled.
Implementations§
Source§impl FheValue
impl FheValue
Sourcepub fn encrypt_bool(_val: bool, _keys: &FheKeys) -> Result<Self>
pub fn encrypt_bool(_val: bool, _keys: &FheKeys) -> Result<Self>
Stub: encrypt a boolean (requires fhe feature)
Sourcepub fn encrypt_u8(_val: u8, _keys: &FheKeys) -> Result<Self>
pub fn encrypt_u8(_val: u8, _keys: &FheKeys) -> Result<Self>
Stub: encrypt a u8 (requires fhe feature)
Sourcepub fn encrypt_u16(_val: u16, _keys: &FheKeys) -> Result<Self>
pub fn encrypt_u16(_val: u16, _keys: &FheKeys) -> Result<Self>
Stub: encrypt a u16 (requires fhe feature)
Sourcepub fn encrypt_u32(_val: u32, _keys: &FheKeys) -> Result<Self>
pub fn encrypt_u32(_val: u32, _keys: &FheKeys) -> Result<Self>
Stub: encrypt a u32 (requires fhe feature)
Sourcepub fn encrypt_u64(_val: u64, _keys: &FheKeys) -> Result<Self>
pub fn encrypt_u64(_val: u64, _keys: &FheKeys) -> Result<Self>
Stub: encrypt a u64 (requires fhe feature)
Sourcepub fn sub(&self, _other: &Self) -> Result<Self>
pub fn sub(&self, _other: &Self) -> Result<Self>
Stub: subtract two values (requires fhe feature)
Sourcepub fn mul(&self, _other: &Self) -> Result<Self>
pub fn mul(&self, _other: &Self) -> Result<Self>
Stub: multiply two values (requires fhe feature)
Sourcepub fn le(&self, _other: &Self) -> Result<Self>
pub fn le(&self, _other: &Self) -> Result<Self>
Stub: compare less-than-or-equal (requires fhe feature)
Sourcepub fn gt(&self, _other: &Self) -> Result<Self>
pub fn gt(&self, _other: &Self) -> Result<Self>
Stub: compare greater-than (requires fhe feature)
Sourcepub fn ge(&self, _other: &Self) -> Result<Self>
pub fn ge(&self, _other: &Self) -> Result<Self>
Stub: compare greater-than-or-equal (requires fhe feature)
Sourcepub fn decrypt_bool(&self, _keys: &FheKeys) -> Result<bool>
pub fn decrypt_bool(&self, _keys: &FheKeys) -> Result<bool>
Stub: decrypt bool (requires fhe feature)
Sourcepub fn decrypt_u8(&self, _keys: &FheKeys) -> Result<u8>
pub fn decrypt_u8(&self, _keys: &FheKeys) -> Result<u8>
Stub: decrypt u8 (requires fhe feature)
Sourcepub fn decrypt_u16(&self, _keys: &FheKeys) -> Result<u16>
pub fn decrypt_u16(&self, _keys: &FheKeys) -> Result<u16>
Stub: decrypt u16 (requires fhe feature)
Sourcepub fn decrypt_u32(&self, _keys: &FheKeys) -> Result<u32>
pub fn decrypt_u32(&self, _keys: &FheKeys) -> Result<u32>
Stub: decrypt u32 (requires fhe feature)
Sourcepub fn decrypt_u64(&self, _keys: &FheKeys) -> Result<u64>
pub fn decrypt_u64(&self, _keys: &FheKeys) -> Result<u64>
Stub: decrypt u64 (requires fhe feature)
Auto Trait Implementations§
impl Freeze for FheValue
impl RefUnwindSafe for FheValue
impl Send for FheValue
impl Sync for FheValue
impl Unpin for FheValue
impl UnsafeUnpin for FheValue
impl UnwindSafe for FheValue
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.