Since https://github.com/bitcoin-core/secp256k1/pull//1777 , libsecp256k1 allows an externally provided SHA256 compression function. This PR plug ours in, so it runs on our SHA-NI/ARMv8/SSE4 hardware optimized implementation instead of the libsecp bare internal one.
The biggest gains are at the signing side, not at the verification side.
Benchmarks at the bench introduction commit (43c9bdbf8ada1b581b5ab1f0a102517c243a60da) and at the tip:
On ARM64, arm_shani implementation
| benchmark | before | after | change |
|---|---|---|---|
ECDSASign |
79.2 µs | 69.3 µs | -13% |
SchnorrSign |
39.9 µs | 37.1 µs | -7% |
ECDSAVerify |
27.4 µs | 27.3 µs | -0% |
SchnorrVerify |
28.1 µs | 27.8 µs | -1% |
EllSwiftCreate |
29.8 µs | 28.8 µs | -3% |
BIP324_ECDH |
30.4 µs | 30.1 µs | -1% |