1
0
mirror of https://github.com/golang/go synced 2024-11-14 09:20:28 -07:00
go/src/crypto/elliptic
Adam Langley b30fcbc9f5 crypto/ecdsa: reject negative inputs.
The fact that crypto/ecdsa.Verify didn't reject negative inputs was a
mistake on my part: I had unsigned numbers on the brain. However, it
doesn't generally cause problems. (ModInverse results in zero, which
results in x being zero, which is rejected.)

The amd64 P-256 code will crash when given a large, negative input.

This fixes both crypto/ecdsa to reject these values and also the P-256
code to ignore the sign of inputs.

Change-Id: I6370ed7ca8125e53225866f55b616a4022b818f8
Reviewed-on: https://go-review.googlesource.com/22093
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-18 14:18:48 +00:00
..
elliptic_test.go crypto/elliptic,crypto/ecdsa: P256 amd64 assembly 2015-11-10 22:16:56 +00:00
elliptic.go crypto/elliptic: resample private keys if out of range. 2015-12-08 17:39:09 +00:00
p224_test.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
p224.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
p256_amd64.go crypto/ecdsa: reject negative inputs. 2016-05-18 14:18:48 +00:00
p256_asm_amd64.s crypto/elliptic,crypto/ecdsa: P256 amd64 assembly 2015-11-10 22:16:56 +00:00
p256.go all: use &^ operator if possible 2016-03-29 14:28:41 +00:00