Struct zk_paillier::zkproofs::CiphertextProof
source · Expand description
This proof shows that a paillier ciphertext was constructed correctly
The proof is taken from https://www.brics.dk/RS/00/14/BRICS-RS-00-14.pdf 9.1.3 Given a ciphertext c and a prover encryption key , a prover wants to prove that it knows (x,r) such that c = Enc(x,r)
- P picks x’,r’ at random, and computes c’ = Enc(x’, r’)
- P computes z1 = x’ + ex , z2 = r’ *r^e (e is a varifier challenge)
- P sends, c’ , z1,z2
- V accepts if 1) Enc(z1,z2 ) = c’ * c^e
Fields
z1: BigInt
z2: BigInt
c_prime: BigInt
Implementations
sourceimpl CiphertextProof
impl CiphertextProof
pub fn prove(
witness: &CiphertextWitness,
statement: &CiphertextStatement
) -> Self
pub fn verify(
&self,
statement: &CiphertextStatement
) -> Result<(), IncorrectProof>
Trait Implementations
sourceimpl Clone for CiphertextProof
impl Clone for CiphertextProof
sourcefn clone(&self) -> CiphertextProof
fn clone(&self) -> CiphertextProof
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for CiphertextProof
impl Debug for CiphertextProof
sourceimpl<'de> Deserialize<'de> for CiphertextProof
impl<'de> Deserialize<'de> for CiphertextProof
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<CiphertextProof> for CiphertextProof
impl PartialEq<CiphertextProof> for CiphertextProof
sourcefn eq(&self, other: &CiphertextProof) -> bool
fn eq(&self, other: &CiphertextProof) -> bool
sourceimpl Serialize for CiphertextProof
impl Serialize for CiphertextProof
impl StructuralPartialEq for CiphertextProof
Auto Trait Implementations
impl RefUnwindSafe for CiphertextProof
impl Send for CiphertextProof
impl Sync for CiphertextProof
impl Unpin for CiphertextProof
impl UnwindSafe for CiphertextProof
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more