def test_signature_aggregation(self, client_regtest): for _ in RANDOM_ITERATIONS: sk0 = Fr.random(self.gen) # secret key pk0 = G2.mul(G2.one, sk0) # public key # we don't have hash-to-curve on g1, so compute a random point msg_hash = G1.random(self.gen) # message hash sig0 = G1.mul(msg_hash, sk0) # signature args0 = [(msg_hash, pk0), (G1.neg(sig0), G2.one)] check_pairing_check(client_regtest, args0) sk1 = Fr.random(self.gen) # secret key pk1 = G2.mul(G2.one, sk1) # public key # we don't have hash-to-curve on g1, so compute a random point sig1 = G1.mul(msg_hash, sk1) # signature args1 = [ (G1.add(msg_hash, msg_hash), G2.add(pk0, pk1)), (G1.neg(G1.add(sig0, sig1)), G2.add(G2.one, G2.one)), ] check_pairing_check(client_regtest, args1)
def test_pairing_neg_g1(self, client_regtest): for _ in RANDOM_ITERATIONS: g1_point = G1.random(self.gen) g2_point = G2.random(self.gen) args = [(g1_point, g2_point), (G1.neg(g1_point), g2_point)] check_pairing_check(client_regtest, args)