Skip to content

Commit cf07510

Browse files
committed
bindings/go/blst.tgo: add SrcRoot() helper.
1 parent 1ff7a25 commit cf07510

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

bindings/go/blst.go

+7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ package blst
1616
// #cgo loong64 mips64 mips64le ppc64 ppc64le riscv64 s390x CFLAGS: -D__BLST_NO_ASM__
1717
//
1818
// #include "blst.h"
19+
// const char *go_blst_src_server_c();
1920
//
2021
// #if defined(__x86_64__) && (defined(__unix__) || defined(__APPLE__))
2122
// # include <signal.h>
@@ -156,6 +157,7 @@ import "C"
156157
import (
157158
"fmt"
158159
"math/bits"
160+
"path/filepath"
159161
"runtime"
160162
"sync"
161163
"sync/atomic"
@@ -217,6 +219,11 @@ var cgo_p1Generator = *C.blst_p1_generator()
217219
var cgo_p2Generator = *C.blst_p2_generator()
218220
var cgo_fp12One = *C.blst_fp12_one()
219221

222+
func SrcRoot() string {
223+
path := C.GoString(C.go_blst_src_server_c())
224+
return filepath.Dir(filepath.Dir(path))
225+
}
226+
220227
// Secret key
221228
func (sk *SecretKey) Zeroize() {
222229
var zero SecretKey

bindings/go/blst.tgo

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ package blst
1212
// #cgo loong64 mips64 mips64le ppc64 ppc64le riscv64 s390x CFLAGS: -D__BLST_NO_ASM__
1313
//
1414
// #include "blst.h"
15+
// const char *go_blst_src_server_c();
1516
//
1617
// #if defined(__x86_64__) && (defined(__unix__) || defined(__APPLE__))
1718
// # include <signal.h>
@@ -207,6 +208,11 @@ var cgo_p1Generator = *C.blst_p1_generator()
207208
var cgo_p2Generator = *C.blst_p2_generator()
208209
var cgo_fp12One = *C.blst_fp12_one()
209210

211+
func SrcRoot() string {
212+
path := C.GoString(C.go_blst_src_server_c())
213+
return filepath.Dir(filepath.Dir(path))
214+
}
215+
210216
//
211217
// Secret key
212218
//

0 commit comments

Comments
 (0)