dcrd/dcrec
Dave Collins 08498b8b24
secp256k1: Avoid inversion in sig verify.
This modifies signature verification to perform the final equality check
in Jacobian projective space to avoid an extra expensive field inversion
by taking advantage of the fact the R component of the signature can be
converted to Jacobian projective space and compared directly so long as
the two possible cases that arise from R being mod N and the original x
coordinate used to create it being mod P.

The following is a before and after comparison of verification of a
typical signature:

benchmark            old ns/op    new ns/op    delta
-----------------------------------------------------
BenchmarkSigVerify   189505       177147       -6.52%

benchmark            old allocs   new allocs   delta
-----------------------------------------------------
BenchmarkSigVerify   34           34           +0.00%

benchmark            old bytes    new bytes    delta
-----------------------------------------------------
BenchmarkSigVerify   1633         1633         +0.00%
2020-03-24 11:12:40 -05:00
..
edwards edwards: Zero internal bytes of big ints. 2020-02-20 21:10:45 -06:00
secp256k1 secp256k1: Avoid inversion in sig verify. 2020-03-24 11:12:40 -05:00
common.go multi: Address some golint complaints. 2018-10-10 19:50:06 -05:00
go.mod build: Tidy module sums (go mod tidy). 2019-03-25 11:37:00 -05:00