Struct zk_paillier::zkproofs::RangeProofNi
source · pub struct RangeProofNi { /* private fields */ }
Expand description
Zero-knowledge range proof that a value x<q/3 lies in interval [0,q].
The verifier is given only c = ENC(ek,x). The prover has input x, dk, r (randomness used for calculating c) It is assumed that q is known to both.
References:
- Appendix A in Lindell’17
- Section 1.2.2 in Boudot ’00
This is a non-interactive version of the proof, using Fiat Shamir Transform and assuming Random Oracle Model
Implementations
sourceimpl RangeProofNi
impl RangeProofNi
pub fn prove(
ek: &EncryptionKey,
range: &BigInt,
ciphertext: &BigInt,
secret_x: &BigInt,
secret_r: &BigInt
) -> RangeProofNi
pub fn verify(
&self,
ek: &EncryptionKey,
ciphertext: &BigInt
) -> Result<(), IncorrectProof>
pub fn verify_self(&self) -> Result<(), IncorrectProof>
Trait Implementations
sourceimpl Clone for RangeProofNi
impl Clone for RangeProofNi
sourcefn clone(&self) -> RangeProofNi
fn clone(&self) -> RangeProofNi
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 RangeProofNi
impl Debug for RangeProofNi
sourceimpl<'de> Deserialize<'de> for RangeProofNi
impl<'de> Deserialize<'de> for RangeProofNi
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 Serialize for RangeProofNi
impl Serialize for RangeProofNi
Auto Trait Implementations
impl RefUnwindSafe for RangeProofNi
impl Send for RangeProofNi
impl Sync for RangeProofNi
impl Unpin for RangeProofNi
impl UnwindSafe for RangeProofNi
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