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% |
||
|---|---|---|
| .. | ||
| edwards | ||
| secp256k1 | ||
| common.go | ||
| go.mod | ||