[−][src]Struct bulletproofs::BulletproofGens
The BulletproofGens
struct contains all the generators needed
for aggregating up to m
range proofs of up to n
bits each.
Extensible Generator Generation
Instead of constructing a single vector of size m*n
, as
described in the Bulletproofs paper, we construct each party's
generators separately.
To construct an arbitrarylength chain of generators, we apply
SHAKE256 to a domain separator label, and feed each 64 bytes of
XOF output into the ristretto255
hashtogroup function.
Each of the m
parties' generators are constructed using a
different domain separation label, and proving and verification
uses the first n
elements of the arbitrarylength chain.
This means that the aggregation size (number of
parties) is orthogonal to the rangeproof size (number of bits),
and allows using the same BulletproofGens
object for different
proving parameters.
This construction is also forwardcompatible with constraint system proofs, which use a much larger slice of the generator chain, and even forwardcompatible to multiparty aggregation of constraint system proofs, since the generators are namespaced by their party index.
Fields
gens_capacity: usize
The maximum number of usable generators for each party.
party_capacity: usize
Number of values or parties
G_vec: Vec<Vec<RistrettoPoint>>
Precomputed \(\mathbf G\) generators for each party.
H_vec: Vec<Vec<RistrettoPoint>>
Precomputed \(\mathbf H\) generators for each party.
Methods
impl BulletproofGens
[src]
pub fn new(gens_capacity: usize, party_capacity: usize) > Self
[src]
Create a new BulletproofGens
object.
Inputs

gens_capacity
is the number of generators to precompute for each party. For rangeproofs, it is sufficient to pass64
, the maximum bitsize of the rangeproofs. For circuit proofs, the capacity must be greater than the number of multipliers, rounded up to the next power of two. 
party_capacity
is the maximum number of parties that can produce an aggregated proof.
pub fn share(&self, j: usize) > BulletproofGensShare
[src]
Returns jth share of generators, with an appropriate slice of vectors G and H for the jth range proof.
pub(crate) fn G(
&self,
n: usize,
m: usize
) > impl Iterator<Item = &RistrettoPoint>
[src]
&self,
n: usize,
m: usize
) > impl Iterator<Item = &RistrettoPoint>
Return an iterator over the aggregation of the parties' G generators with given size n
.
pub(crate) fn H(
&self,
n: usize,
m: usize
) > impl Iterator<Item = &RistrettoPoint>
[src]
&self,
n: usize,
m: usize
) > impl Iterator<Item = &RistrettoPoint>
Return an iterator over the aggregation of the parties' H generators with given size n
.
Trait Implementations
impl Clone for BulletproofGens
[src]
fn clone(&self) > BulletproofGens
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copyassignment from source
. Read more
Auto Trait Implementations
impl Send for BulletproofGens
impl Sync for BulletproofGens
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) > Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) > Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) > &mut T
[src]
impl<T> Same for T
type Output = T
Should always be Self