[−][src]Struct bulletproofs::inner_product_proof::InnerProductProof
Fields
L_vec: Vec<CompressedRistretto>
R_vec: Vec<CompressedRistretto>
a: Scalar
b: Scalar
Methods
impl InnerProductProof
[src]
pub fn create(
transcript: &mut Transcript,
Q: &RistrettoPoint,
G_factors: &[Scalar],
H_factors: &[Scalar],
G_vec: Vec<RistrettoPoint>,
H_vec: Vec<RistrettoPoint>,
a_vec: Vec<Scalar>,
b_vec: Vec<Scalar>
) -> InnerProductProof
[src]
transcript: &mut Transcript,
Q: &RistrettoPoint,
G_factors: &[Scalar],
H_factors: &[Scalar],
G_vec: Vec<RistrettoPoint>,
H_vec: Vec<RistrettoPoint>,
a_vec: Vec<Scalar>,
b_vec: Vec<Scalar>
) -> InnerProductProof
Create an inner-product proof.
The proof is created with respect to the bases \(G\), \(H'\), where \(H'_i = H_i \cdot \texttt{Hprime\_factors}_i\).
The verifier
is passed in as a parameter so that the
challenges depend on the entire transcript (including parent
protocols).
The lengths of the vectors must all be the same, and must all be either 0 or a power of 2.
pub(crate) fn verification_scalars(
&self,
n: usize,
transcript: &mut Transcript
) -> Result<(Vec<Scalar>, Vec<Scalar>, Vec<Scalar>), ProofError>
[src]
&self,
n: usize,
transcript: &mut Transcript
) -> Result<(Vec<Scalar>, Vec<Scalar>, Vec<Scalar>), ProofError>
Computes three vectors of verification scalars \([u_{i}^{2}]\), \([u_{i}^{-2}]\) and \([s_{i}]\) for combined multiscalar multiplication in a parent protocol. See inner product protocol notes for details. The verifier must provide the input length \(n\) explicitly to avoid unbounded allocation within the inner product proof.
pub fn verify<IG, IH>(
&self,
n: usize,
transcript: &mut Transcript,
G_factors: IG,
H_factors: IH,
P: &RistrettoPoint,
Q: &RistrettoPoint,
G: &[RistrettoPoint],
H: &[RistrettoPoint]
) -> Result<(), ProofError> where
IG: IntoIterator,
IG::Item: Borrow<Scalar>,
IH: IntoIterator,
IH::Item: Borrow<Scalar>,
[src]
&self,
n: usize,
transcript: &mut Transcript,
G_factors: IG,
H_factors: IH,
P: &RistrettoPoint,
Q: &RistrettoPoint,
G: &[RistrettoPoint],
H: &[RistrettoPoint]
) -> Result<(), ProofError> where
IG: IntoIterator,
IG::Item: Borrow<Scalar>,
IH: IntoIterator,
IH::Item: Borrow<Scalar>,
This method is for testing that proof generation work,
but for efficiency the actual protocols would use verification_scalars
method to combine inner product verification with other checks
in a single multiscalar multiplication.
pub fn serialized_size(&self) -> usize
[src]
Returns the size in bytes required to serialize the inner product proof.
For vectors of length n
the proof size is
\(32 \cdot (2\lg n+2)\) bytes.
pub fn to_bytes(&self) -> Vec<u8>
[src]
Serializes the proof into a byte array of \(2n+2\) 32-byte elements. The layout of the inner product proof is:
- \(n\) pairs of compressed Ristretto points \(L_0, R_0 \dots, L_{n-1}, R_{n-1}\),
- two scalars \(a, b\).
pub(crate) fn to_bytes_iter(&self) -> impl Iterator<Item = u8> + '_
[src]
Converts the proof into a byte iterator over serialized view of the proof. The layout of the inner product proof is:
- \(n\) pairs of compressed Ristretto points \(L_0, R_0 \dots, L_{n-1}, R_{n-1}\),
- two scalars \(a, b\).
pub fn from_bytes(slice: &[u8]) -> Result<InnerProductProof, ProofError>
[src]
Deserializes the proof from a byte slice. Returns an error in the following cases:
- the slice does not have \(2n+2\) 32-byte elements,
- \(n\) is larger or equal to 32 (proof is too big),
- any of \(2n\) points are not valid compressed Ristretto points,
- any of 2 scalars are not canonical scalars modulo Ristretto group order.
Trait Implementations
impl Clone for InnerProductProof
[src]
fn clone(&self) -> InnerProductProof
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for InnerProductProof
[src]
Auto Trait Implementations
impl RefUnwindSafe for InnerProductProof
impl Send for InnerProductProof
impl Sync for InnerProductProof
impl Unpin for InnerProductProof
impl UnwindSafe for InnerProductProof
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> Cast<U> for T where
U: FromCast<T>,
U: FromCast<T>,
fn cast(self) -> U
impl<T> From<T> for T
[src]
impl<T> FromBits<T> for T
fn from_bits(t: T) -> T
impl<T> FromCast<T> for T
fn from_cast(t: T) -> T
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> IntoBits<U> for T where
U: FromBits<T>,
U: FromBits<T>,
fn into_bits(self) -> U
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,