pub struct CiphertextWithValue<G: Group, V: Zeroize = <G as ScalarOps>::Scalar> { /* private fields */ }
Expand description
ElGamal Ciphertext
together with fully retained information about the encrypted value and
randomness used to create the ciphertext.
This type can be used to produce certain kinds of proofs, such as
SumOfSquaresProof
.
Implementations§
Source§impl<G: Group, V> CiphertextWithValue<G, V>
impl<G: Group, V> CiphertextWithValue<G, V>
Sourcepub fn new<R: CryptoRng + RngCore>(
value: V,
receiver: &PublicKey<G>,
rng: &mut R,
) -> Self
pub fn new<R: CryptoRng + RngCore>( value: V, receiver: &PublicKey<G>, rng: &mut R, ) -> Self
Encrypts a value for the specified receiver.
This is a lower-level operation compared to PublicKey::encrypt()
and should be used
if the resulting ciphertext is necessary to produce proofs.
Sourcepub fn generalize(self) -> CiphertextWithValue<G>
pub fn generalize(self) -> CiphertextWithValue<G>
Converts the enclosed value into a scalar.
Source§impl<G: Group, V> CiphertextWithValue<G, V>
impl<G: Group, V> CiphertextWithValue<G, V>
Sourcepub fn inner(&self) -> &Ciphertext<G>
pub fn inner(&self) -> &Ciphertext<G>
Returns a reference to the contained Ciphertext
.
Trait Implementations§
Source§impl<G: Group, V: Zeroize> From<CiphertextWithValue<G, V>> for Ciphertext<G>
impl<G: Group, V: Zeroize> From<CiphertextWithValue<G, V>> for Ciphertext<G>
Source§fn from(ciphertext: CiphertextWithValue<G, V>) -> Self
fn from(ciphertext: CiphertextWithValue<G, V>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<G, V> Freeze for CiphertextWithValue<G, V>
impl<G, V> RefUnwindSafe for CiphertextWithValue<G, V>where
V: RefUnwindSafe,
<G as ElementOps>::Element: RefUnwindSafe,
<G as ScalarOps>::Scalar: RefUnwindSafe,
impl<G, V> Send for CiphertextWithValue<G, V>
impl<G, V> Sync for CiphertextWithValue<G, V>
impl<G, V> Unpin for CiphertextWithValue<G, V>
impl<G, V> UnwindSafe for CiphertextWithValue<G, V>
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