aboutsummaryrefslogtreecommitdiffstats
path: root/go/bls
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2017-06-04 05:55:43 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2017-06-04 05:55:43 +0800
commit5a38c2e8c9a27555229e9cd61455caf1aa3d8907 (patch)
treee9ab1cbf24a5f65601cea7e6681044b83b947d5d /go/bls
parent1682083203424fee2670e8e1c57f4786ed8b3234 (diff)
downloaddexon-bls-5a38c2e8c9a27555229e9cd61455caf1aa3d8907.tar
dexon-bls-5a38c2e8c9a27555229e9cd61455caf1aa3d8907.tar.gz
dexon-bls-5a38c2e8c9a27555229e9cd61455caf1aa3d8907.tar.bz2
dexon-bls-5a38c2e8c9a27555229e9cd61455caf1aa3d8907.tar.lz
dexon-bls-5a38c2e8c9a27555229e9cd61455caf1aa3d8907.tar.xz
dexon-bls-5a38c2e8c9a27555229e9cd61455caf1aa3d8907.tar.zst
dexon-bls-5a38c2e8c9a27555229e9cd61455caf1aa3d8907.zip
rename bls_if.h to bls.h
Diffstat (limited to 'go/bls')
-rw-r--r--go/bls/bls.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/go/bls/bls.go b/go/bls/bls.go
index 8c34d7e..bbf765d 100644
--- a/go/bls/bls.go
+++ b/go/bls/bls.go
@@ -2,10 +2,10 @@ package bls
/*
#cgo CFLAGS:-I../../include
-#cgo LDFLAGS:-lbls_if -lbls -lmcl -lgmpxx -lstdc++ -lgmp -lcrypto -L../../lib -L../../../mcl/lib
-#cgo bn256 CFLAGS:-UBLS_MAX_OP_UNIT_SIZE -DBLS_MAX_OP_UNIT_SIZE=4
-#cgo bn384 CFLAGS:-UBLS_MAX_OP_UNIT_SIZE -DBLS_MAX_OP_UNIT_SIZE=6
-#include <bls/bls_if.h>
+#cgo LDFLAGS:-lbls384 -lmcl -lgmpxx -lstdc++ -lgmp -lcrypto -L../../lib -L../../../mcl/lib
+#cgo bn256 CFLAGS:-UBLS_FP_UNIT_SIZE -DBLS_FP_UNIT_SIZE=4
+#cgo bn384 CFLAGS:-UBLS_FP_UNIT_SIZE -DBLS_FP_UNIT_SIZE=6
+#include <bls/bls.h>
*/
import "C"
import "fmt"
@@ -24,7 +24,7 @@ const CurveFp382_2 = 2
// call this function before calling all the other operations
// this function is not thread safe
func Init(curve int) error {
- err := C.blsInit(C.int(curve), C.BLS_MAX_OP_UNIT_SIZE)
+ err := C.blsInit(C.int(curve), C.BLS_FP_UNIT_SIZE)
if err != 0 {
return fmt.Errorf("ERR Init curve=%d", curve)
}
@@ -33,7 +33,7 @@ func Init(curve int) error {
// GetMaxOpUnitSize --
func GetMaxOpUnitSize() int {
- return int(C.BLS_MAX_OP_UNIT_SIZE)
+ return int(C.BLS_FP_UNIT_SIZE)
}
// GetOpUnitSize --
@@ -65,7 +65,7 @@ func GetFieldOrder() string {
// ID --
type ID struct {
- v [C.BLS_MAX_OP_UNIT_SIZE]C.uint64_t
+ v [C.BLS_FP_UNIT_SIZE]C.uint64_t
}
// getPointer --
@@ -146,7 +146,7 @@ func (id *ID) IsEqual(rhs *ID) bool {
// SecretKey --
type SecretKey struct {
- v [C.BLS_MAX_OP_UNIT_SIZE]C.uint64_t
+ v [C.BLS_FP_UNIT_SIZE]C.uint64_t
}
// getPointer --
@@ -282,7 +282,7 @@ func (sec *SecretKey) GetPop() (sign *Sign) {
// PublicKey --
type PublicKey struct {
- v [C.BLS_MAX_OP_UNIT_SIZE * 2 * 3]C.uint64_t
+ v [C.BLS_FP_UNIT_SIZE * 2 * 3]C.uint64_t
}
// getPointer --
@@ -364,7 +364,7 @@ func (pub *PublicKey) Recover(pubVec []PublicKey, idVec []ID) error {
// Sign --
type Sign struct {
- v [C.BLS_MAX_OP_UNIT_SIZE * 3]C.uint64_t
+ v [C.BLS_FP_UNIT_SIZE * 3]C.uint64_t
}
// getPointer --