feat: use proper constructor syntax for inner product
This commit is contained in:
parent
5b41d62f8a
commit
1a254ec098
|
@ -36,7 +36,7 @@ impl InnerProductProof {
|
||||||
/// The lengths of the vectors must all be the same, and must all be
|
/// The lengths of the vectors must all be the same, and must all be
|
||||||
/// either 0 or a power of 2.
|
/// either 0 or a power of 2.
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn create(
|
pub fn new(
|
||||||
Q: &RistrettoPoint,
|
Q: &RistrettoPoint,
|
||||||
G_factors: &[Scalar],
|
G_factors: &[Scalar],
|
||||||
H_factors: &[Scalar],
|
H_factors: &[Scalar],
|
||||||
|
@ -45,7 +45,7 @@ impl InnerProductProof {
|
||||||
mut a_vec: Vec<Scalar>,
|
mut a_vec: Vec<Scalar>,
|
||||||
mut b_vec: Vec<Scalar>,
|
mut b_vec: Vec<Scalar>,
|
||||||
transcript: &mut Transcript,
|
transcript: &mut Transcript,
|
||||||
) -> InnerProductProof {
|
) -> Self {
|
||||||
// Create slices G, H, a, b backed by their respective
|
// Create slices G, H, a, b backed by their respective
|
||||||
// vectors. This lets us reslice as we compress the lengths
|
// vectors. This lets us reslice as we compress the lengths
|
||||||
// of the vectors in the main loop below.
|
// of the vectors in the main loop below.
|
||||||
|
@ -437,7 +437,7 @@ mod tests {
|
||||||
let mut prover_transcript = Transcript::new(b"innerproducttest");
|
let mut prover_transcript = Transcript::new(b"innerproducttest");
|
||||||
let mut verifier_transcript = Transcript::new(b"innerproducttest");
|
let mut verifier_transcript = Transcript::new(b"innerproducttest");
|
||||||
|
|
||||||
let proof = InnerProductProof::create(
|
let proof = InnerProductProof::new(
|
||||||
&Q,
|
&Q,
|
||||||
&G_factors,
|
&G_factors,
|
||||||
&H_factors,
|
&H_factors,
|
||||||
|
|
|
@ -196,7 +196,7 @@ impl RangeProof {
|
||||||
// generate challenge `c` for consistency with the verifier's transcript
|
// generate challenge `c` for consistency with the verifier's transcript
|
||||||
transcript.challenge_scalar(b"c");
|
transcript.challenge_scalar(b"c");
|
||||||
|
|
||||||
let ipp_proof = InnerProductProof::create(
|
let ipp_proof = InnerProductProof::new(
|
||||||
&Q,
|
&Q,
|
||||||
&G_factors,
|
&G_factors,
|
||||||
&H_factors,
|
&H_factors,
|
||||||
|
|
Loading…
Reference in New Issue