fin-proof: edition fixes in the fin crate
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
8ec49ad9ab
commit
3de63e1a17
2 changed files with 6 additions and 7 deletions
|
|
@ -23,8 +23,7 @@ impl Bls for ZkBls {
|
|||
fn verify_aggregate(&self, pubkeys: &[[u8; PUBKEY_LEN]], msg: &[u8], dst: &[u8], sig: &[u8; SIG_LEN]) -> bool {
|
||||
use bls12_381::hash_to_curve::{ExpandMsgXmd, HashToCurve};
|
||||
use bls12_381::{multi_miller_loop, G1Affine, G1Projective, G2Affine, G2Prepared, G2Projective, Gt};
|
||||
use group::prime::PrimeCurveAffine;
|
||||
use group::{Curve, Group};
|
||||
use group::Curve;
|
||||
if pubkeys.is_empty() {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -45,7 +44,7 @@ impl Bls for ZkBls {
|
|||
return false;
|
||||
}
|
||||
let s = s.unwrap();
|
||||
let hm: G2Projective = <G2Projective as HashToCurve<ExpandMsgXmd<sha2::Sha256>>>::hash_to_curve(msg, dst);
|
||||
let hm: G2Projective = <G2Projective as HashToCurve<ExpandMsgXmd<sha2::Sha256>>>::hash_to_curve(&[msg], dst);
|
||||
let agg_affine = agg.to_affine();
|
||||
let neg_g1 = -G1Affine::generator();
|
||||
let r = multi_miller_loop(&[(&agg_affine, &G2Prepared::from(hm.to_affine())), (&neg_g1, &G2Prepared::from(s))]).final_exponentiation();
|
||||
|
|
|
|||
|
|
@ -74,10 +74,10 @@ impl MmrProof {
|
|||
let mut count = 0u64;
|
||||
let mut last: Option<u8> = None;
|
||||
for &(h, _) in &self.peaks {
|
||||
if let Some(l) = last
|
||||
&& l <= h
|
||||
{
|
||||
return false;
|
||||
if let Some(l) = last {
|
||||
if l <= h {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
last = Some(h);
|
||||
count += 1u64 << h;
|
||||
|
|
|
|||
Loading…
Reference in a new issue