Remove unused Challenge trait.

This commit is contained in:
therealyingtong 2021-05-25 00:55:34 +08:00
parent a9c991d826
commit ddde5f200c
2 changed files with 3 additions and 9 deletions

View File

@ -256,7 +256,7 @@ fn bench_with_k(name: &str, k: u32, c: &mut Criterion) {
};
// Create a proof
let mut transcript = Blake2bWrite::<_, _, Challenge255>::init(vec![]);
let mut transcript = Blake2bWrite::<_, _, Challenge255<_>>::init(vec![]);
create_proof(&params, &pk, &[circuit], &[&[]], &mut transcript)
.expect("proof generation should not fail")
});
@ -268,7 +268,7 @@ fn bench_with_k(name: &str, k: u32, c: &mut Criterion) {
};
// Create a proof
let mut transcript = Blake2bWrite::<_, _, Challenge255>::init(vec![]);
let mut transcript = Blake2bWrite::<_, _, Challenge255<_>>::init(vec![]);
create_proof(&params, &pk, &[circuit], &[&[]], &mut transcript)
.expect("proof generation should not fail");
let proof = transcript.finalize();
@ -276,7 +276,7 @@ fn bench_with_k(name: &str, k: u32, c: &mut Criterion) {
c.bench_function(&verifier_name, |b| {
b.iter(|| {
let msm = params.empty_msm();
let mut transcript = Blake2bRead::<_, _, Challenge255>::init(&proof[..]);
let mut transcript = Blake2bRead::<_, _, Challenge255<_>>::init(&proof[..]);
let guard = verify_proof(&params, pk.get_vk(), msm, &[&[]], &mut transcript).unwrap();
let msm = guard.clone().use_challenges();
assert!(msm.eval());

View File

@ -209,12 +209,6 @@ impl<W: Write, C: CurveAffine> Transcript<C, Challenge255<C>>
}
}
/// `Challenge` trait implemented for challenges of different lengths
pub trait Challenge: Copy + Clone + std::fmt::Debug {
/// Try to create challenge of appropriate length.
fn new(challenge: &[u8]) -> Self;
}
/// The scalar representation of a verifier challenge.
///
/// The `Type` type can be used to scope the challenge to a specific context, or