diff options
Diffstat (limited to 'go/main.go')
-rw-r--r-- | go/main.go | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -28,6 +28,27 @@ func testRecoverSecretKey() { fmt.Println("sec2=", sec2) } +func testAdd() { + fmt.Println("testAdd") + sec1 := bls.NewSecretKey() + sec2 := bls.NewSecretKey() + sec1.Init() + sec2.Init() + + pub1 := sec1.GetPublicKey() + pub2 := sec2.GetPublicKey() + + m := "test test" + sign1 := sec1.Sign(m) + sign2 := sec2.Sign(m) + + fmt.Println("sign1 :", sign1) + sign1.Add(sign2) + fmt.Println("sign1 add:", sign1) + pub1.Add(pub2) + fmt.Println("add sign:", sign1.Verify(pub1, m)) +} + func main() { fmt.Println("init") bls.Init() @@ -62,4 +83,5 @@ func main() { } } testRecoverSecretKey() + testAdd() } |