smc_range_proof/lib.rs
1#![cfg_attr(not(feature = "std"), no_std)]
2#![allow(non_snake_case)]
3
4//! Implements the following range proof and set-membership protocols.
5//! 1. Set membership protocol using BB signature. Described in Fig.1 of the paper [1]. [Code](/src/ccs_set_membership)
6//! 2. Range proof protocol as described in Fig.3 of the paper [1]. Considers a perfect-range, i.e. range of the form `[0, u^l)`
7//! where `u` is the base and the upper bound is a power of the base. [Code](src/ccs_range_proof/perfect_range.rs)
8//! 3. Range proof protocol as described in section 4.4 of the paper [1]. Considers an arbitrary range `[min, max)`. Some
9//! differences with the paper, check the module for more details. [Code](src/ccs_range_proof/arbitrary_range.rs)
10//! 4. Range proof using sumsets, based on Protocol 2 from the paper [2] but considers range [min, max) and not [0, max]. [Code](src/smc_range_proof.rs)
11//! 5. Implements the Keyed-Verification of the above protocols where the verifier knows the secret key of the BB sig. This makes
12//! the proof generation and verification more efficient by removing the need for pairings. This idea is taken from this PhD. thesis.
13//!
14//! Above protocols use a pairing based signature called the weak-BB signature.
15//!
16//! UPDATE: Implements variations of above protocols which use an optimized version of proving knowledge of weak-BB
17//! signature described in section 2.4 of the paper [3] which does not require the prover to do pairings which makes the
18//! proofs much shorter and faster to verify. This paper will be called the CDH paper
19//!
20//! References:
21//!
22//! [1]: [Efficient Protocols for Set Membership and Range Proofs](https://link.springer.com/chapter/10.1007/978-3-540-89255-7_15)
23//!
24//! [2]: [Additive Combinatorics and Discrete Logarithm Based Range Protocols](https://eprint.iacr.org/2009/469)
25//!
26//! [3]: [Scalable Revocation Scheme for Anonymous Credentials Based on n-times Unlinkable Proofs](http://library.usc.edu.ph/ACM/SIGSAC%202017/wpes/p123.pdf)
27
28#[macro_use]
29pub mod common;
30pub mod ccs_range_proof;
31pub mod ccs_set_membership;
32mod cls_range_proof;
33pub mod error;
34
35pub mod prelude {
36 pub use crate::{
37 ccs_range_proof::{
38 CCSArbitraryRangeProof, CCSArbitraryRangeProofProtocol,
39 CCSArbitraryRangeProofWithKVProtocol, CCSArbitraryRangeWithKVProof,
40 },
41 ccs_set_membership::setup::{
42 SetMembershipCheckParams, SetMembershipCheckParamsWithPairing,
43 },
44 cls_range_proof::{
45 CLSRangeProof, CLSRangeProofProtocol, CLSRangeProofWithKV, CLSRangeProofWithKVProtocol,
46 },
47 common::{
48 MemberCommitmentKey, PublicKeyG2, SecretKey, SignatureG1, SignatureParams,
49 SignatureParamsWithPairing,
50 },
51 error::SmcRangeProofError,
52 };
53}