Struct zk_paillier::zkproofs::VerlinProof
source · pub struct VerlinProof {
pub phi_a: BigInt,
pub z: BigInt,
pub z_prime: BigInt,
pub z_double_prime: BigInt,
pub r_z: BigInt,
}
Expand description
A sigma protocol to allow a prover to demonstrate that a ciphertext c_x has been computed using two other ciphertexts c_cprime, as well as a known value.
The proof is taken from https://eprint.iacr.org/2011/494.pdf 3.3.1
Witness: {x,x_prime, x_double_prime, r_x}
Statement: {c_x, c, c_prime}.
The relation is such that: phi_x = c^x * c_prime^x_prime * Enc(x_double_prime, r_x)
The protocol:
- Prover picks random: a,a_prime,a_double_prime and r_a and computes: phi_a
- prover computes a challenge e using Fiat-Shamir
- Prover computes z = xe + a, z’ = x’e + a’, z_double_prime = x_double_primee + a_double_prime and r_z = r_x^er_a
Verifier accepts if phi_z = phi_x^e * phi_a
Fields
phi_a: BigInt
z: BigInt
z_prime: BigInt
z_double_prime: BigInt
r_z: BigInt
Implementations
sourceimpl VerlinProof
impl VerlinProof
pub fn prove(witness: &VerlinWitness, statement: &VerlinStatement) -> Self
pub fn verify(&self, statement: &VerlinStatement) -> Result<(), IncorrectProof>
Trait Implementations
sourceimpl Clone for VerlinProof
impl Clone for VerlinProof
sourcefn clone(&self) -> VerlinProof
fn clone(&self) -> VerlinProof
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 VerlinProof
impl Debug for VerlinProof
sourceimpl<'de> Deserialize<'de> for VerlinProof
impl<'de> Deserialize<'de> for VerlinProof
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<VerlinProof> for VerlinProof
impl PartialEq<VerlinProof> for VerlinProof
sourcefn eq(&self, other: &VerlinProof) -> bool
fn eq(&self, other: &VerlinProof) -> bool
sourceimpl Serialize for VerlinProof
impl Serialize for VerlinProof
impl StructuralPartialEq for VerlinProof
Auto Trait Implementations
impl RefUnwindSafe for VerlinProof
impl Send for VerlinProof
impl Sync for VerlinProof
impl Unpin for VerlinProof
impl UnwindSafe for VerlinProof
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