pub struct Ciphertext<P> {
pub ephemeral_public: P,
pub blinded_message: P,
}Expand description
ElGamal ciphertext consisting of a pair $(c_1, c_2)$.
The ciphertext is formed as:
$$ c_1 = rG, \quad c_2 = M + r \mathsf{PK} $$
where:
- $r$ is a random
- $G$ is the generator of the group
- $PK$ is the recipient’s public key
- $M$ is the plaintext message point
This struct stores the two ciphertext components.
Fields§
§ephemeral_public: PThe ephemeral public component $c_1 = r G$.
blinded_message: PThe blinded message component $c_2 = M + r \mathsf{PK}$.
Trait Implementations§
Source§impl<P: Clone> Clone for Ciphertext<P>
impl<P: Clone> Clone for Ciphertext<P>
Source§fn clone(&self) -> Ciphertext<P>
fn clone(&self) -> Ciphertext<P>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<P: Debug> Debug for Ciphertext<P>
impl<P: Debug> Debug for Ciphertext<P>
Source§impl<P: PartialEq> PartialEq for Ciphertext<P>
impl<P: PartialEq> PartialEq for Ciphertext<P>
impl<P: Eq> Eq for Ciphertext<P>
impl<P> StructuralPartialEq for Ciphertext<P>
Auto Trait Implementations§
impl<P> Freeze for Ciphertext<P>where
P: Freeze,
impl<P> RefUnwindSafe for Ciphertext<P>where
P: RefUnwindSafe,
impl<P> Send for Ciphertext<P>where
P: Send,
impl<P> Sync for Ciphertext<P>where
P: Sync,
impl<P> Unpin for Ciphertext<P>where
P: Unpin,
impl<P> UnsafeUnpin for Ciphertext<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for Ciphertext<P>where
P: UnwindSafe,
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