Branch: refs/heads/master
Home: https://github.com/btcsuite/btcec
Commit: 95b23c293ce2c3a717fc01bc449803eeadd572ef
https://github.com/btcsuite/btcec/commit/95b23c293ce2c3a717fc01bc449803eeadd572ef
Author: Jimmy Song <[email protected]>
Date: 2015-02-03 (Tue, 03 Feb 2015)
Changed paths:
M bench_test.go
M btcec.go
M btcec_test.go
M gensecp256k1.go
M signature.go
Log Message:
-----------
Optimize ScalarMult using endomorphism
This implements a speedup to ScalarMult using the endomorphism available to
secp256k1.
Note the constants lambda, beta, a1, b1, a2 and b2 are from here:
https://bitcointalk.org/index.php?topic=3238.0
Preliminary tests indicate a speedup of between 17%-20% (BenchScalarMult).
More speedup can probably be achieved once splitK uses something more like what
fieldVal uses. Unfortunately, the prime for this math is the order of G (N),
not P.
Note the NAF optimization was specifically not done as that's the purview of
another issue.
Changed both ScalarMult and ScalarBaseMult to take advantage of curve.N to
reduce k.
This results in a 80% speedup to large values of k for ScalarBaseMult.
Note the new test BenchmarkScalarBaseMultLarge is how that speedup number can
be checked.
This closes #1