leishman / bls_lib Goto Github PK
View Code? Open in Web Editor NEWBLS Signature Library
BLS Signature Library
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;
}
I have many messages (for example, 2^32), can I use your code to aggregate?
For example, I sig the messages one by one, and then I aggregate all the signatures, publish the aggregated signature. So, anyone can check any message of the messages by the aggregated signature.
Hey,
I would like to use your signature aggregation algorithm in the cryptocurrency that I am developing in order to reduce the block size.
What tests and research do I need to put in, in order to make this production ready.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.