Skip to content

Commit

Permalink
Fix cargo fmt and std compilation
Browse files Browse the repository at this point in the history
Signed-off-by: Kirk Baird <baird.k@outlook.com>
  • Loading branch information
kirk-baird committed Jan 9, 2020
1 parent 7859948 commit 67cfdcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/aggregates.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
extern crate amcl;
extern crate rand;

use amcl::bls381::pair;
use super::amcl_utils::{
self, ate2_evaluation, ate_pairing, hash_on_g2, BigNum, GroupG1, GroupG2, FP12,
};
Expand All @@ -10,6 +9,7 @@ use super::g1::{G1Point, G1Wrapper};
use super::g2::G2Point;
use super::keys::PublicKey;
use super::signature::Signature;
use amcl::bls381::pair;
use rand::Rng;
use BLSCurve::pair::{ate, ate2, fexp};

Expand Down Expand Up @@ -132,7 +132,7 @@ impl AggregateSignature {
msg_hash_point.affine();

// Faster ate2 evaualtion checks e(S, -G1) * e(H, PK) == 1
let mut generator_g1_negative = amcl_utils::GENERATORG1.clone();
let mut generator_g1_negative = amcl_utils::GroupG1::generator();
generator_g1_negative.neg();
ate2_evaluation(
&sig_point.as_raw(),
Expand Down Expand Up @@ -199,12 +199,11 @@ impl AggregateSignature {
I: Iterator<Item = (G2Point, Vec<G1Point>, Vec<Vec<u8>>, u64)>,
{
let mut final_agg_sig = GroupG2::new(); // Aggregates AggregateSignature
//let mut rhs_pairs: Vec<AtePair> = vec![]; // e(H(1,1), P(1,1)), e(H(1,2), P(1,2)), ..., e(H(n,m), P(n,m))
//let mut rhs_pairs: Vec<AtePair> = vec![]; // e(H(1,1), P(1,1)), e(H(1,2), P(1,2)), ..., e(H(n,m), P(n,m))

// Stores current value of pairings
let mut r = pair::initmp();


for (g2_point, g1_points, msgs, domain) in signature_sets {
if g1_points.len() != msgs.len() {
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl Signature {
msg_hash_point.affine();

// Faster ate2 evaualtion checks e(S, -G1) * e(H, PK) == 1
let mut generator_g1_negative = amcl_utils::GENERATORG1.clone();
let mut generator_g1_negative = amcl_utils::GroupG1::generator();
generator_g1_negative.neg();
ate2_evaluation(
&self.point.as_raw(),
Expand Down

0 comments on commit 67cfdcf

Please sign in to comment.