X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fgogost%2Fgost3410%2F2012_test.go;h=1814691ae210b09e33ef77f10dcb0fb1f0b4a3bc;hb=3f0105abe94dc598a5aa321abb6437f5b492d675;hp=9871bf16ca0f87f1a58aa0fe41f35083a6811565;hpb=014be6ab0719643d1e2996a360ab0619124b7e0e;p=gogost.git diff --git a/src/cypherpunks.ru/gogost/gost3410/2012_test.go b/src/cypherpunks.ru/gogost/gost3410/2012_test.go index 9871bf1..1814691 100644 --- a/src/cypherpunks.ru/gogost/gost3410/2012_test.go +++ b/src/cypherpunks.ru/gogost/gost3410/2012_test.go @@ -1,5 +1,5 @@ // GoGOST -- Pure Go GOST cryptographic functions library -// Copyright (C) 2015-2017 Sergey Matveev +// Copyright (C) 2015-2019 Sergey Matveev // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -175,12 +175,12 @@ func TestGCL3Vectors(t *testing.T) { } func TestRandom2012(t *testing.T) { - c, _ := NewCurveFromParams(CurveParamsGostR34102012TC26ParamSetA) - f := func(data [31]byte, digest [64]byte) bool { + c := CurveIdtc26gost341012512paramSetA() + f := func(prvRaw [64 - 1]byte, digest [64]byte) bool { prv, err := NewPrivateKey( c, Mode2012, - append([]byte{0xde}, data[:]...), + append([]byte{0xde}, prvRaw[:]...), ) if err != nil { return false @@ -210,7 +210,7 @@ func TestRandom2012(t *testing.T) { } func BenchmarkSign2012(b *testing.B) { - c, _ := NewCurveFromParams(CurveParamsGostR34102012TC26ParamSetA) + c := CurveIdtc26gost341012512paramSetA() prv, err := GenPrivateKey(c, Mode2012, rand.Reader) if err != nil { b.FailNow() @@ -224,7 +224,7 @@ func BenchmarkSign2012(b *testing.B) { } func BenchmarkVerify2012(b *testing.B) { - c, _ := NewCurveFromParams(CurveParamsGostR34102012TC26ParamSetA) + c := CurveIdtc26gost341012512paramSetA() prv, err := GenPrivateKey(c, Mode2012, rand.Reader) if err != nil { b.FailNow()