Struct zk_paillier::zkproofs::RangeProof
source · pub struct RangeProof;
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 an interactive version of the proof, assuming only DCRA which is alreasy assumed for Paillier cryptosystem security
Implementations
sourceimpl RangeProof
impl RangeProof
pub fn verifier_commit(
ek: &EncryptionKey
) -> (Commitment, ChallengeRandomness, ChallengeBits)
pub fn generate_encrypted_pairs(
ek: &EncryptionKey,
range: &BigInt,
error_factor: usize
) -> (EncryptedPairs, DataRandomnessPairs)
pub fn verify_commit(
ek: &EncryptionKey,
com: &Commitment,
r: &ChallengeRandomness,
e: &ChallengeBits
) -> Result<(), IncorrectProof>
pub fn generate_proof(
ek: &EncryptionKey,
secret_x: &BigInt,
secret_r: &BigInt,
e: &ChallengeBits,
range: &BigInt,
data: &DataRandomnessPairs,
error_factor: usize
) -> Proof
pub fn verifier_output(
ek: &EncryptionKey,
e: &ChallengeBits,
encrypted_pairs: &EncryptedPairs,
proof: &Proof,
range: &BigInt,
cipher_x: &BigInt,
error_factor: usize
) -> Result<(), IncorrectProof>
Auto Trait Implementations
impl RefUnwindSafe for RangeProof
impl Send for RangeProof
impl Sync for RangeProof
impl Unpin for RangeProof
impl UnwindSafe for RangeProof
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