def test_core_aggregate_verify(SKs, messages): PKs = [G2Basic.SkToPk(sk) for sk in SKs] messages = [bytes(msg) for msg in messages] signatures = [ G2Basic._CoreSign(sk, msg, G2Basic.DST) for sk, msg in zip(SKs, messages) ] aggregate_signature = G2Basic.Aggregate(signatures) assert G2Basic._CoreAggregateVerify(PKs, messages, aggregate_signature, G2Basic.DST)
def test_sign_verify(privkey): msg = str(privkey).encode('utf-8') pub = G2Basic.SkToPk(privkey) sig = G2Basic._CoreSign(privkey, msg, G2Basic.DST) assert G2Basic._CoreVerify(pub, msg, sig, G2Basic.DST)