pub struct Value(pub u128);
Expand description
A plaintext integer value.
While only encryptions of 64-bit values are supported, the Value
type
holds a u128
internally, because the sum of 64-bit values may exceed 64
bits. Attempting to encrypt a Value
bigger than 64 bits will fail.
Tuple Fields§
§0: u128
Implementations§
Source§impl Value
impl Value
Sourcepub fn transparent_encrypt<R: RngCore + CryptoRng>(
&self,
encryption_key: &EncryptionKey,
rng: R,
) -> Result<(Ciphertext, TransparentEncryptionProof)>
pub fn transparent_encrypt<R: RngCore + CryptoRng>( &self, encryption_key: &EncryptionKey, rng: R, ) -> Result<(Ciphertext, TransparentEncryptionProof)>
Encrypt this value to the given EncryptionKey
, producing a
Ciphertext
and a (transparent) encryption proof.
While the transparent encryption proof reveals the ciphertext, the rest of the encryption should be secure – this is a stub interface prior to implementing ZK-SNARK based encryption proofs.
Trait Implementations§
impl Eq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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