diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2017-04-23 21:01:50 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2017-04-23 21:01:50 +0800 |
commit | c7b481bb530f2632c05e58b779bf2c6ca0e4a8a2 (patch) | |
tree | 9d87317073648a9cc2c45d5bb53ea91fc863c993 /go/bls/bls_test.go | |
parent | 947f42a7c84718e5a0434f69f1faff4adc01227f (diff) | |
download | dexon-bls-c7b481bb530f2632c05e58b779bf2c6ca0e4a8a2.tar dexon-bls-c7b481bb530f2632c05e58b779bf2c6ca0e4a8a2.tar.gz dexon-bls-c7b481bb530f2632c05e58b779bf2c6ca0e4a8a2.tar.bz2 dexon-bls-c7b481bb530f2632c05e58b779bf2c6ca0e4a8a2.tar.lz dexon-bls-c7b481bb530f2632c05e58b779bf2c6ca0e4a8a2.tar.xz dexon-bls-c7b481bb530f2632c05e58b779bf2c6ca0e4a8a2.tar.zst dexon-bls-c7b481bb530f2632c05e58b779bf2c6ca0e4a8a2.zip |
add GetCurveOrder/GetFieldOrder to Go
Diffstat (limited to 'go/bls/bls_test.go')
-rw-r--r-- | go/bls/bls_test.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/go/bls/bls_test.go b/go/bls/bls_test.go index 50f1b7e..4a8ccbf 100644 --- a/go/bls/bls_test.go +++ b/go/bls/bls_test.go @@ -228,6 +228,31 @@ func testData(t *testing.T) { } } +func testOrder(t *testing.T, c int) { + var curve string + var field string + if c == CurveFp254BNb { + curve = "16798108731015832284940804142231733909759579603404752749028378864165570215949" + field = "16798108731015832284940804142231733909889187121439069848933715426072753864723" + } else if c == CurveFp382_1 { + curve = "5540996953667913971058039301942914304734176495422447785042938606876043190415948413757785063597439175372845535461389" + field = "5540996953667913971058039301942914304734176495422447785045292539108217242186829586959562222833658991069414454984723" + } else if c == CurveFp382_2 { + curve = "5541245505022739011583672869577435255026888277144126952448297309161979278754528049907713682488818304329661351460877" + field = "5541245505022739011583672869577435255026888277144126952450651294188487038640194767986566260919128250811286032482323" + } else { + t.Fatal("bad c", c) + } + var s string + s = GetCurveOrder() + if s != curve { + t.Errorf("bad curve order\n%s\n%s\n", s, curve) + } + s = GetFieldOrder() + if s != field { + t.Errorf("bad field order\n%s\n%s\n", s, field) + } +} func test(t *testing.T, c int) { Init(c) @@ -240,6 +265,7 @@ func test(t *testing.T, c int) { testPop(t) testData(t) testStringConversion(t) + testOrder(t, c) } func TestMain(t *testing.T) { @@ -257,6 +283,7 @@ func TestMain(t *testing.T) { // Benchmarks var curve = CurveFp382_1 + //var curve = CurveFp254BNb func BenchmarkPubkeyFromSeckey(b *testing.B) { |