mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-26 20:26:19 +08:00
MAGIC - remove useless code
This commit is contained in:
parent
6ef7234916
commit
39492b01bf
@ -44,10 +44,6 @@ type PrivateKey struct {
|
||||
ecdsa.PrivateKey
|
||||
}
|
||||
|
||||
type ecdsaSignature struct {
|
||||
R, S *big.Int
|
||||
}
|
||||
|
||||
type pointMarshalMode byte
|
||||
|
||||
const (
|
||||
|
@ -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")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user