Skip to content

opt_atePairing does not have 4 parameters #9

@huyuguang

Description

@huyuguang

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions