From 5a38c2e8c9a27555229e9cd61455caf1aa3d8907 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Sun, 4 Jun 2017 06:55:43 +0900 Subject: rename bls_if.h to bls.h --- go/bls/bls.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'go/bls') 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 +#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 */ 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 -- -- cgit v1.2.3