mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-26 12:16:20 +08:00
fix bug introduced by https://go-review.googlesource.com/c/go/+/233939
This commit is contained in:
parent
dc5c7205f0
commit
3914a43b10
@ -4,11 +4,15 @@
|
|||||||
package sm2
|
package sm2
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"crypto/elliptic"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
|
"io"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var _ = elliptic.P256()
|
||||||
|
|
||||||
func TestFuzz(t *testing.T) {
|
func TestFuzz(t *testing.T) {
|
||||||
p256 := P256()
|
p256 := P256()
|
||||||
p256Generic := p256.Params()
|
p256Generic := p256.Params()
|
||||||
@ -30,8 +34,8 @@ func TestFuzz(t *testing.T) {
|
|||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
rand.Read(scalar1[:])
|
io.ReadFull(rand.Reader, scalar1[:])
|
||||||
rand.Read(scalar2[:])
|
io.ReadFull(rand.Reader, scalar2[:])
|
||||||
|
|
||||||
x, y := p256.ScalarBaseMult(scalar1[:])
|
x, y := p256.ScalarBaseMult(scalar1[:])
|
||||||
x2, y2 := p256Generic.ScalarBaseMult(scalar1[:])
|
x2, y2 := p256Generic.ScalarBaseMult(scalar1[:])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user