diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2016-09-07 04:31:08 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2016-09-07 04:31:08 +0800 |
commit | 120b575604e6fb8a84188a5ce6cb138ffd295f5c (patch) | |
tree | d1d34e59d2e6d16ce1361ce715fe27a06f38ae02 /go/main.go | |
parent | a359f1b668fd8e385162379df5f5d8a9d4545d44 (diff) | |
download | dexon-bls-120b575604e6fb8a84188a5ce6cb138ffd295f5c.tar dexon-bls-120b575604e6fb8a84188a5ce6cb138ffd295f5c.tar.gz dexon-bls-120b575604e6fb8a84188a5ce6cb138ffd295f5c.tar.bz2 dexon-bls-120b575604e6fb8a84188a5ce6cb138ffd295f5c.tar.lz dexon-bls-120b575604e6fb8a84188a5ce6cb138ffd295f5c.tar.xz dexon-bls-120b575604e6fb8a84188a5ce6cb138ffd295f5c.tar.zst dexon-bls-120b575604e6fb8a84188a5ce6cb138ffd295f5c.zip |
add Recover of PublicKey/Sign
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() } |