Struct elastic_elgamal::CiphertextWithValue
source · 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