mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-26 12:16:20 +08:00
MAGIC - consider performance, just base zero check
This commit is contained in:
parent
586ab84f33
commit
798dbe465e
@ -193,7 +193,7 @@ func Encrypt(random io.Reader, pub *ecdsa.PublicKey, msg []byte, opts *Encrypter
|
||||
opts = &defaultEncrypterOpts
|
||||
}
|
||||
//A3, requirement is to check if h*P is infinite point, h is 1
|
||||
if (pub.X.Sign() == 0 && pub.Y.Sign() == 0) || !curve.IsOnCurve(pub.X, pub.Y) {
|
||||
if pub.X.Sign() == 0 && pub.Y.Sign() == 0 {
|
||||
return nil, errors.New("SM2: invalid public key")
|
||||
}
|
||||
for {
|
||||
|
Loading…
x
Reference in New Issue
Block a user