Struct zk_paillier::zkproofs::ZeroProof
source · Expand description
The proof allows a prover to prove that a ciphertext is an encryption of zero.
It is taken from DJ01 [https://www.brics.dk/RS/00/45/BRICS-RS-00-45.pdf] protocol for n^s power for s=1.
Both P and V know a ciphertext c. P knows randomness r such that c= r^n mod n^2
The protocol:
- P chooses a random r’ and computes a = r’^n mod n^2
- P computes z = r’*r^e mod n^2 (e is the verifier challenge)
- V checks that z^n = a*c^e mod n^2
Fields
z: BigInt
a: BigInt
Implementations
sourceimpl ZeroProof
impl ZeroProof
pub fn prove(witness: &ZeroWitness, statement: &ZeroStatement) -> Self
pub fn verify(&self, statement: &ZeroStatement) -> Result<(), IncorrectProof>
Trait Implementations
sourceimpl<'de> Deserialize<'de> for ZeroProof
impl<'de> Deserialize<'de> for ZeroProof
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
impl StructuralPartialEq for ZeroProof
Auto Trait Implementations
impl RefUnwindSafe for ZeroProof
impl Send for ZeroProof
impl Sync for ZeroProof
impl Unpin for ZeroProof
impl UnwindSafe for ZeroProof
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