aboutsummaryrefslogtreecommitdiffstats
path: root/go
diff options
context:
space:
mode:
Diffstat (limited to 'go')
-rw-r--r--go/bls/bls.go8
-rw-r--r--go/main.go5
2 files changed, 13 insertions, 0 deletions
diff --git a/go/bls/bls.go b/go/bls/bls.go
index 0506c10..2f7e8ca 100644
--- a/go/bls/bls.go
+++ b/go/bls/bls.go
@@ -88,6 +88,14 @@ func (sec *SecretKey) SetStr(s string) error {
return nil
}
+func (sec *SecretKey) SetArray(v []uint64) error {
+ if len(v) != 4 {
+ return fmt.Errorf("bad size", len(v))
+ }
+ C.blsSecretKeySetArray(sec.self, (*C.uint64_t)(unsafe.Pointer(&v[0])))
+ return nil
+}
+
func (sec *SecretKey) Init() {
C.blsSecretKeyInit(sec.self)
}
diff --git a/go/main.go b/go/main.go
index 880e3ce..956b8b2 100644
--- a/go/main.go
+++ b/go/main.go
@@ -115,6 +115,11 @@ func main() {
id2.SetStr(id.String())
fmt.Println("id2:", id2)
}
+ {
+ sec := bls.NewSecretKey()
+ sec.SetArray([]uint64{1, 2, 3, 4})
+ fmt.Println("sec=", sec)
+ }
fmt.Println("create secret key")
m := "this is a bls sample for go"