diff --git a/sm2/sm2.go b/sm2/sm2.go index 05278b3..61cbfa2 100644 --- a/sm2/sm2.go +++ b/sm2/sm2.go @@ -44,10 +44,6 @@ type PrivateKey struct { ecdsa.PrivateKey } -type ecdsaSignature struct { - R, S *big.Int -} - type pointMarshalMode byte const ( diff --git a/sm2/sm2_test.go b/sm2/sm2_test.go index e69d51c..b5a5659 100644 --- a/sm2/sm2_test.go +++ b/sm2/sm2_test.go @@ -99,11 +99,11 @@ func Test_signVerify(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { hash := sm3.Sum([]byte(tt.plainText)) - r, s, err := Sign(rand.Reader, &priv.PrivateKey, hash[:]) + signature, err := priv.Sign(rand.Reader, hash[:], nil) if err != nil { t.Fatalf("sign failed %v", err) } - result := Verify(&priv.PublicKey, hash[:], r, s) + result := VerifyASN1(&priv.PublicKey, hash[:], signature) if !result { t.Fatal("verify failed") }