aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--go/bls/bls.go4
-rw-r--r--go/main.go6
2 files changed, 5 insertions, 5 deletions
diff --git a/go/bls/bls.go b/go/bls/bls.go
index 976c884..97f0fe4 100644
--- a/go/bls/bls.go
+++ b/go/bls/bls.go
@@ -155,7 +155,7 @@ func makeIdPointerArray(v []Id) (pv []*C.blsId) {
}
return pv
}
-func (sec *SecretKey) Set(msk []SecretKey, id Id) {
+func (sec *SecretKey) Set(msk []SecretKey, id *Id) {
v := makeSecretKeyPointerArray(msk)
C.blsSecretKeySet(sec.self, (**C.blsSecretKey)(unsafe.Pointer(&v[0])), C.size_t(len(msk)), id.self)
}
@@ -208,7 +208,7 @@ func (pub *PublicKey) SetStr(s string) error {
func (pub *PublicKey) Add(rhs *PublicKey) {
C.blsPublicKeyAdd(pub.self, rhs.self);
}
-func (sec *PublicKey) Set(msk []PublicKey, id Id) {
+func (sec *PublicKey) Set(msk []PublicKey, id *Id) {
v := makePublicKeyPointerArray(msk)
C.blsPublicKeySet(sec.self, (**C.blsPublicKey)(unsafe.Pointer(&v[0])), C.size_t(len(msk)), id.self)
}
diff --git a/go/main.go b/go/main.go
index 1ad8cc1..73bdd43 100644
--- a/go/main.go
+++ b/go/main.go
@@ -25,7 +25,7 @@ func testRecoverSecretKey() {
idVec[i] = *bls.NewId()
idVec[i].Set([]uint64{1, 2, 3, uint64(i)})
secVec[i] = *bls.NewSecretKey()
- secVec[i].Set(msk, idVec[i])
+ secVec[i].Set(msk, &idVec[i])
}
// recover sec2 from secVec and idVec
sec2 := bls.NewSecretKey()
@@ -61,10 +61,10 @@ func testSign() {
fmt.Printf("idVec[%d]=%s\n", i, idVec[i].String())
secVec[i] = *bls.NewSecretKey()
- secVec[i].Set(msk, idVec[i])
+ secVec[i].Set(msk, &idVec[i])
pubVec[i] = *bls.NewPublicKey()
- pubVec[i].Set(mpk, idVec[i])
+ pubVec[i].Set(mpk, &idVec[i])
fmt.Printf("pubVec[%d]=%s\n", i, pubVec[i].String())
verifyTrue(pubVec[i].String() == secVec[i].GetPublicKey().String())