mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-26 12:16:20 +08:00
sm2: fix bug
This commit is contained in:
parent
167f0e0b11
commit
58d30f6655
@ -377,6 +377,7 @@ func NewPublicKey(key []byte) (*ecdsa.PublicKey, error) {
|
||||
return nil, err
|
||||
}
|
||||
k := new(ecdsa.PublicKey)
|
||||
k.Curve = c.curve
|
||||
k.X, k.Y, err = c.pointToAffine(p)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -19,7 +19,7 @@ func TestEqual(t *testing.T) {
|
||||
t.Errorf("private.Public() is not Equal to public: %q", public)
|
||||
}
|
||||
if !private.Equal(private) {
|
||||
t.Errorf("private key is not equal to itself: %q", private)
|
||||
t.Errorf("private key is not equal to itself")
|
||||
}
|
||||
|
||||
enc, err := MarshalPKCS8PrivateKey(private)
|
||||
|
Loading…
x
Reference in New Issue
Block a user