mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +00:00
crypto: fix TestToECDSAErrors for nocgo, better way to check after review
This commit is contained in:
parent
5d5404e75d
commit
8fd55bd266
1 changed files with 1 additions and 2 deletions
|
|
@ -103,8 +103,7 @@ func toECDSA(d []byte, strict bool) (*ecdsa.PrivateKey, error) {
|
|||
return nil, fmt.Errorf("invalid private key, >=N")
|
||||
}
|
||||
// The priv.D must not be zero or negative.
|
||||
zero := new(big.Int).SetInt64(0)
|
||||
if priv.D.Cmp(zero) <= 0 {
|
||||
if priv.D.Sign() <= 0 {
|
||||
return nil, fmt.Errorf("invalid private key, zero or negative")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue