Update sm2.go

trigger build
This commit is contained in:
Sun Yimin 2021-06-28 12:20:37 +08:00 committed by GitHub
parent 54b8eb12be
commit 9a011f124a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -604,7 +604,7 @@ func (z *zr) Read(dst []byte) (n int, err error) {
var zeroReader = &zr{} var zeroReader = &zr{}
// IsSM2PublicKey check if given public key is SM2 public key or not // IsSM2PublicKey check if given public key is a SM2 public key or not
func IsSM2PublicKey(publicKey interface{}) bool { func IsSM2PublicKey(publicKey interface{}) bool {
pub, ok := publicKey.(*ecdsa.PublicKey) pub, ok := publicKey.(*ecdsa.PublicKey)
return ok && strings.EqualFold(P256().Params().Name, pub.Curve.Params().Name) return ok && strings.EqualFold(P256().Params().Name, pub.Curve.Params().Name)