[zk-token-sdk] clean-up range-proof docs (#33803)
* add/fix docs for range proof * remove pre-compute generators todo * remove double check generators todo
This commit is contained in:
parent
8e0acf481c
commit
c3d588b3f1
|
@ -6,10 +6,7 @@ use {
|
|||
sha3::{Sha3XofReader, Shake256},
|
||||
};
|
||||
|
||||
/// Generators for Pedersen vector commitments.
|
||||
///
|
||||
/// The code is copied from https://github.com/dalek-cryptography/bulletproofs for now...
|
||||
|
||||
/// Generators for Pedersen vector commitments that are used for inner-product proofs.
|
||||
struct GeneratorsChain {
|
||||
reader: Sha3XofReader,
|
||||
}
|
||||
|
@ -80,14 +77,6 @@ impl BulletproofGens {
|
|||
gens
|
||||
}
|
||||
|
||||
// pub fn new_aggregate(gens_capacities: Vec<usize>) -> Vec<BulletproofGens> {
|
||||
// let mut gens_vector = Vec::new();
|
||||
// for (capacity, i) in gens_capacities.iter().enumerate() {
|
||||
// gens_vector.push(BulletproofGens::new(capacity, &i.to_le_bytes()));
|
||||
// }
|
||||
// gens_vector
|
||||
// }
|
||||
|
||||
/// Increases the generators' capacity to the amount specified.
|
||||
/// If less than or equal to the current capacity, does nothing.
|
||||
pub fn increase_capacity(&mut self, new_capacity: usize) {
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
//! The Bulletproofs range-proof implementation over Curve25519 Ristretto points.
|
||||
//!
|
||||
//! The implementation is based on the dalek-cryptography bulletproofs
|
||||
//! [implementation](https://github.com/dalek-cryptography/bulletproofs). Compared to the original
|
||||
//! implementation by dalek-cryptography:
|
||||
//! - This implementation focuses on the range proof implementation, while the dalek-cryptography
|
||||
//! crate additionally implements the general bulletproofs implementation for languages that can be
|
||||
//! represented by arithmetic circuits as well as MPC.
|
||||
//! - This implementation implements a non-interactive range proof aggregation that is specified in
|
||||
//! the original Bulletproofs [paper](https://eprint.iacr.org/2017/1066) (Section 4.3).
|
||||
//!
|
||||
|
||||
#[cfg(not(target_os = "solana"))]
|
||||
use {
|
||||
crate::encryption::pedersen::{Pedersen, PedersenCommitment, PedersenOpening},
|
||||
|
@ -69,8 +81,6 @@ impl RangeProof {
|
|||
let nm: usize = bit_lengths.iter().sum();
|
||||
assert!(nm.is_power_of_two());
|
||||
|
||||
// TODO: precompute generators
|
||||
// TODO: double check Pedersen generators and range proof generators does not interfere
|
||||
let bp_gens = BulletproofGens::new(nm);
|
||||
|
||||
// bit-decompose values and generate their Pedersen vector commitment
|
||||
|
|
Loading…
Reference in New Issue