aboutsummaryrefslogtreecommitdiffstats
path: root/go
diff options
context:
space:
mode:
Diffstat (limited to 'go')
-rw-r--r--go/bls/bls_test.go7
-rw-r--r--go/bls/mcl.go4
2 files changed, 8 insertions, 3 deletions
diff --git a/go/bls/bls_test.go b/go/bls/bls_test.go
index 5d5d432..400f90d 100644
--- a/go/bls/bls_test.go
+++ b/go/bls/bls_test.go
@@ -292,6 +292,9 @@ func testOrder(t *testing.T, c int) {
} else if c == CurveFp382_2 {
curve = "5541245505022739011583672869577435255026888277144126952448297309161979278754528049907713682488818304329661351460877"
field = "5541245505022739011583672869577435255026888277144126952450651294188487038640194767986566260919128250811286032482323"
+ } else if c == BLS12_381 {
+ curve = "52435875175126190479447740508185965837690552500527637822603658699938581184513"
+ field = "4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559787"
} else {
t.Fatal("bad c", c)
}
@@ -343,8 +346,8 @@ func TestMain(t *testing.T) {
if GetMaxOpUnitSize() == 6 {
t.Log("CurveFp382_1")
test(t, CurveFp382_1)
- t.Log("CurveFp382_2")
- test(t, CurveFp382_2)
+ t.Log("BLS12_381")
+ test(t, BLS12_381)
}
}
diff --git a/go/bls/mcl.go b/go/bls/mcl.go
index 504fc7c..00feebc 100644
--- a/go/bls/mcl.go
+++ b/go/bls/mcl.go
@@ -3,7 +3,6 @@ package bls
/*
#cgo CFLAGS:-DMCLBN_FP_UNIT_SIZE=6
#include <mcl/bn.h>
-#include <bls/bls.h>
*/
import "C"
import "fmt"
@@ -18,6 +17,9 @@ const CurveFp382_1 = C.mclBn_CurveFp382_1
// CurveFp382_2 -- 382 bit curve 2
const CurveFp382_2 = C.mclBn_CurveFp382_2
+// BLS12_381
+const BLS12_381 = C.MCL_BLS12_381
+
// GetMaxOpUnitSize --
func GetMaxOpUnitSize() int {
return int(C.MCLBN_FP_UNIT_SIZE)