mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-26 04:06:18 +08:00
MAGIC - remove useless code
This commit is contained in:
parent
6ef7234916
commit
39492b01bf
@ -44,10 +44,6 @@ type PrivateKey struct {
|
|||||||
ecdsa.PrivateKey
|
ecdsa.PrivateKey
|
||||||
}
|
}
|
||||||
|
|
||||||
type ecdsaSignature struct {
|
|
||||||
R, S *big.Int
|
|
||||||
}
|
|
||||||
|
|
||||||
type pointMarshalMode byte
|
type pointMarshalMode byte
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -99,11 +99,11 @@ func Test_signVerify(t *testing.T) {
|
|||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
hash := sm3.Sum([]byte(tt.plainText))
|
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 {
|
if err != nil {
|
||||||
t.Fatalf("sign failed %v", err)
|
t.Fatalf("sign failed %v", err)
|
||||||
}
|
}
|
||||||
result := Verify(&priv.PublicKey, hash[:], r, s)
|
result := VerifyASN1(&priv.PublicKey, hash[:], signature)
|
||||||
if !result {
|
if !result {
|
||||||
t.Fatal("verify failed")
|
t.Fatal("verify failed")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user