Skip to main content

Module functions

Module functions 

Source
Expand description

Functions for zero-knowledge proof systems.

Functions§

build_zk_proof
Construct a ZK proof for a witness under a given statement.
dlog_prove
Prove knowledge of secret such that generator^secret ≡ public (mod p).
dlog_verify
Verify a Schnorr discrete-log proof.
modpow
Fast modular exponentiation: base^exp mod modulus.
pedersen_commit
Compute the Pedersen commitment g^x * h^r mod p.
pedersen_open
Verify that a commitment opens correctly: check g^x * h^r ≡ c.value (mod p).
prove_range
Prove that lo ≤ x ≤ hi using bit decomposition.
sigma_protocol_properties
Return the three standard properties of the basic (Schnorr) Sigma protocol.
toy_params
Toy Pedersen parameters using a small safe prime for testing.
verify_range_proof
Verify a bit-decomposition range proof.
verify_zk_proof
Verify a multi-secret ZK proof given public keys and parameters.