Fix bug and inconsistant error msg seen by lint.

This commit is contained in:
John C. Vernaleo 2014-09-08 09:29:39 -04:00 committed by Dave Collins
parent 46829e8ddc
commit d4d2f622b5
2 changed files with 2 additions and 2 deletions

View file

@ -506,7 +506,7 @@ func (curve *KoblitzCurve) doubleZ1EqualsOne(x1, y1, x3, y3, z3 *fieldVal) {
// any assumptions about the z value and stores the result in (x3, y3, z3). // any assumptions about the z value and stores the result in (x3, y3, z3).
// That is to say (x3, y3, z3) = 2*(x1, y1, z1). It is the slowest of the point // That is to say (x3, y3, z3) = 2*(x1, y1, z1). It is the slowest of the point
// doubling routines due to requiring the most arithmetic. // doubling routines due to requiring the most arithmetic.
func (cuve *KoblitzCurve) doubleGeneric(x1, y1, z1, x3, y3, z3 *fieldVal) { func (curve *KoblitzCurve) doubleGeneric(x1, y1, z1, x3, y3, z3 *fieldVal) {
// Point doubling formula for Jacobian coordinates for the secp256k1 // Point doubling formula for Jacobian coordinates for the secp256k1
// curve: // curve:
// X3 = (3*X1^2)^2 - 8*X1*Y1^2 // X3 = (3*X1^2)^2 - 8*X1*Y1^2

View file

@ -283,7 +283,7 @@ func recoverKeyFromSignature(curve *KoblitzCurve, sig *Signature, msg []byte,
if doChecks { if doChecks {
nRx, nRy := curve.ScalarMult(Rx, Ry, curve.Params().N.Bytes()) nRx, nRy := curve.ScalarMult(Rx, Ry, curve.Params().N.Bytes())
if nRx.Sign() != 0 || nRy.Sign() != 0 { if nRx.Sign() != 0 || nRy.Sign() != 0 {
return nil, errors.New("R*n does not equal the point at infinity") return nil, errors.New("n*R does not equal the point at infinity")
} }
} }