Use uncapitalized error strings
This commit is contained in:
parent
961636c764
commit
e748650cc8
1 changed files with 4 additions and 4 deletions
|
@ -100,16 +100,16 @@ func ParseSignature(sigStr []byte, curve elliptic.Curve) (*Signature, error) {
|
||||||
// FWIW the ecdsa spec states that R and S must be | 1, N - 1 |
|
// FWIW the ecdsa spec states that R and S must be | 1, N - 1 |
|
||||||
// but crypto/ecdsa only checks for Sign != 0. Mirror that.
|
// but crypto/ecdsa only checks for Sign != 0. Mirror that.
|
||||||
if signature.R.Sign() != 1 {
|
if signature.R.Sign() != 1 {
|
||||||
return nil, errors.New("Signature R isn't 1 or more")
|
return nil, errors.New("signature R isn't 1 or more")
|
||||||
}
|
}
|
||||||
if signature.S.Sign() != 1 {
|
if signature.S.Sign() != 1 {
|
||||||
return nil, errors.New("Signature S isn't 1 or more")
|
return nil, errors.New("signature S isn't 1 or more")
|
||||||
}
|
}
|
||||||
if signature.R.Cmp(curve.Params().N) >= 0 {
|
if signature.R.Cmp(curve.Params().N) >= 0 {
|
||||||
return nil, errors.New("Signature R is >= curve.N")
|
return nil, errors.New("signature R is >= curve.N")
|
||||||
}
|
}
|
||||||
if signature.S.Cmp(curve.Params().N) >= 0 {
|
if signature.S.Cmp(curve.Params().N) >= 0 {
|
||||||
return nil, errors.New("Signature S is >= curve.N")
|
return nil, errors.New("signature S is >= curve.N")
|
||||||
}
|
}
|
||||||
|
|
||||||
return signature, nil
|
return signature, nil
|
||||||
|
|
Loading…
Reference in a new issue