mirror of
https://github.com/saymrwulf/pasta_curves-source.git
synced 2026-09-04 20:03:39 +00:00
Clippy fixes
This commit is contained in:
parent
0b2ec8965f
commit
72471dc07e
3 changed files with 14 additions and 39 deletions
|
|
@ -283,14 +283,10 @@ fn test_opening_proof() {
|
|||
let mut transcript = Transcript::init_with_hashers(&hasher, &scalar_hasher);
|
||||
|
||||
loop {
|
||||
let transcript_dup = transcript.clone();
|
||||
let mut transcript_dup = transcript.clone();
|
||||
|
||||
let opening_proof = Proof::create(¶ms, &mut transcript, &px, blind, x);
|
||||
if opening_proof.is_err() {
|
||||
transcript = transcript_dup;
|
||||
transcript.absorb_base(Field::one());
|
||||
} else {
|
||||
let opening_proof = opening_proof.unwrap();
|
||||
if let Ok(opening_proof) = opening_proof {
|
||||
// Verify the opening proof
|
||||
let mut commitment_msm = params.empty_msm();
|
||||
commitment_msm.append_term(Field::one(), p);
|
||||
|
|
@ -298,7 +294,7 @@ fn test_opening_proof() {
|
|||
.verify(
|
||||
¶ms,
|
||||
params.empty_msm(),
|
||||
&mut transcript_dup.clone(),
|
||||
&mut transcript_dup,
|
||||
x,
|
||||
commitment_msm,
|
||||
v,
|
||||
|
|
@ -315,33 +311,12 @@ fn test_opening_proof() {
|
|||
let g = guard.compute_g();
|
||||
let (msm_g, _accumulator) = guard.clone().use_g(g);
|
||||
assert!(msm_g.eval());
|
||||
}
|
||||
|
||||
// Check another proof to populate `msm.g_scalars`
|
||||
let msm = guard.use_challenges();
|
||||
let mut commitment_msm = params.empty_msm();
|
||||
commitment_msm.append_term(Field::one(), p);
|
||||
let guard = opening_proof
|
||||
.verify(
|
||||
¶ms,
|
||||
msm,
|
||||
&mut transcript_dup.clone(),
|
||||
x,
|
||||
commitment_msm,
|
||||
v,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
// Test use_challenges()
|
||||
let msm_challenges = guard.clone().use_challenges();
|
||||
assert!(msm_challenges.eval());
|
||||
|
||||
// Test use_g()
|
||||
let g = guard.compute_g();
|
||||
let (msm_g, _accumulator) = guard.clone().use_g(g);
|
||||
assert!(msm_g.eval());
|
||||
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
transcript = transcript_dup;
|
||||
transcript.absorb_base(Field::one());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -658,11 +658,11 @@ fn test_zeta() {
|
|||
);
|
||||
|
||||
let a = Fp::ZETA;
|
||||
assert!(bool::from(a != Fp::one()));
|
||||
assert!(a != Fp::one());
|
||||
let b = a * a;
|
||||
assert!(bool::from(b != Fp::one()));
|
||||
assert!(b != Fp::one());
|
||||
let c = b * a;
|
||||
assert!(bool::from(c == Fp::one()));
|
||||
assert!(c == Fp::one());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -672,11 +672,11 @@ fn test_zeta() {
|
|||
"0x36c66d3a1e049a5887ad8b5ff9731ffe69cf8de720e52ec14394c2bd148fa4fd"
|
||||
);
|
||||
let a = Fq::ZETA;
|
||||
assert!(bool::from(a != Fq::one()));
|
||||
assert!(a != Fq::one());
|
||||
let b = a * a;
|
||||
assert!(bool::from(b != Fq::one()));
|
||||
assert!(b != Fq::one());
|
||||
let c = b * a;
|
||||
assert!(bool::from(c == Fq::one()));
|
||||
assert!(c == Fq::one());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Reference in a new issue