Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opt_atePairing does not have 4 parameters #9

Open
huyuguang opened this issue Jun 4, 2018 · 0 comments
Open

opt_atePairing does not have 4 parameters #9

huyuguang opened this issue Jun 4, 2018 · 0 comments

Comments

@huyuguang
Copy link

opt_atePairing(pairing_prod, pubkeys[0].ec2, hashed_msg_point, !delay_exp);
what is the delay_exp?
I check the opt_atePairing in bn.h, the define is:
void opt_atePairing(Fp12T<Fp6T<Fp2T > >& f, const Fp2T Q[2], const Fp P[2])

bool Bls::verifyAggSig(const std::vector<const char*> &messages, const std::vector<PubKey> &pubkeys, const Sig &sig, bool delay_exp) {
	// check that same number of messages and pubkeys
	if (messages.size() != pubkeys.size()) {
		cerr << "SIZES NOT EQUAL" << endl;
		return false;
	}

	// calculate initial pairing
	Fp12 pairing_prod;
	Ec1 hashed_msg_point = hashMsgWithPubkey(messages[0], pubkeys[0].ec2);
	opt_atePairing(pairing_prod, pubkeys[0].ec2, hashed_msg_point, !delay_exp);

	// Set for checking that all messages are unique
	std::vector<Ec1> hashed_msgs;
	hashed_msgs.push_back(hashed_msg_point);

	for (size_t i = 1; i < messages.size(); i++) {
		Fp12 pairing_i;
		Ec1 hashed_msg_point = hashMsgWithPubkey(messages[i], pubkeys[i].ec2);
		Ec2 pubkey = pubkeys[i].ec2;
		hashed_msgs.push_back(hashed_msg_point);
		opt_atePairing(pairing_i, pubkey, hashed_msg_point, !delay_exp);
		pairing_prod *= pairing_i;
	}

	if (delay_exp) {
		pairing_prod.final_exp();
	}

	// calculate pairing with agg signature
	Fp12 pairing_agg;
	opt_atePairing(pairing_agg, g2, sig.ec1);

	return pairing_agg == pairing_prod;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant