@@ -47,6 +47,9 @@ func TestBLSSigningAndVerification(t *testing.T) {
47
47
fooSignature := PrivateKeySign (fooPrivateKey , fooMessage )
48
48
barSignature := PrivateKeySign (barPrivateKey , barMessage )
49
49
50
+ // get the aggregateSign
51
+ aggregateSign := Aggregate ([]Signature {* fooSignature , * barSignature })
52
+
50
53
// assert the foo message was signed with the foo key
51
54
assert .True (t , Verify (fooSignature , []Digest {fooDigest }, []PublicKey {fooPublicKey }))
52
55
@@ -66,6 +69,12 @@ func TestBLSSigningAndVerification(t *testing.T) {
66
69
assert .False (t , Verify (barSignature , []Digest {barDigest }, []PublicKey {fooPublicKey }))
67
70
assert .False (t , Verify (barSignature , []Digest {fooDigest }, []PublicKey {barPublicKey }))
68
71
assert .False (t , Verify (fooSignature , []Digest {barDigest }, []PublicKey {fooPublicKey }))
72
+
73
+ //assert the foo and bar message was signed with the foo and bar key
74
+ assert .True (t , HashVerify (aggregateSign , []Message {fooMessage , barMessage }, []PublicKey {fooPublicKey , barPublicKey }))
75
+
76
+ //assert the bar and foo message was not signed by the foo and bar key
77
+ assert .False (t , HashVerify (aggregateSign , []Message {fooMessage , barMessage }, []PublicKey {fooPublicKey }))
69
78
}
70
79
71
80
func BenchmarkBLSVerify (b * testing.B ) {
0 commit comments