This repository has been archived by the owner on Aug 7, 2023. It is now read-only.
forked from decred/dcrd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
secp256k1: Optimize and correct normalize.
This modifies the normalize function of the internal field value to both optimize it and address an issue where the reduction could lead to an incorrect result with a small range of values. It also adds tests to ensure the behavior is correct. The following benchmark shows the relative speedups as a result of the optimization on my system. In particular, the changes result in approximately a 14% speedup in Normalize, which ultimately translates to a 2% speedup in signature verifies. benchmark old ns/op new ns/op delta -------------------------------------------------------------------- BenchmarkAddJacobian 1364 1289 -5.50% BenchmarkAddJacobianNotZOne 3150 3091 -1.87% BenchmarkScalarBaseMult 134117 132816 -0.97% BenchmarkScalarBaseMultLarge 135067 132966 -1.56% BenchmarkScalarMult 411218 402217 -2.19% BenchmarkSigVerify 671585 657833 -2.05% BenchmarkFieldNormalize 36.0 31.0 -13.89%
- Loading branch information
Showing
2 changed files
with
143 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters