Branch: refs/heads/master
  Home:   https://github.com/conformal/btcec
  Commit: 9be5c5cbd92803f5e7bce7cd20235500ecf9dbdf
      
https://github.com/conformal/btcec/commit/9be5c5cbd92803f5e7bce7cd20235500ecf9dbdf
  Author: Dave Collins <[email protected]>
  Date:   2013-12-20 (Fri, 20 Dec 2013)

  Changed paths:
    M btcec.go
    A field.go

  Log Message:
  -----------
  Significantly optimize signature verification.

This commit essentially rewrites all of the primitives needed to perform
the arithmetic for ECDSA signature verification of secp256k1 signatures to
significantly speed it up.  Benchmarking has shown signature verification
is roughly 10 times faster with this commit over the previous.

In particular, it introduces a new field value which is used to perform the
modular field arithmetic using fixed-precision operations specifically
tailored for the secp256k1 prime.  The field also takes advantage of
special properties of the prime for significantly faster modular reduction
than is available through generic methods.

In addition, the curve point addition and doubling have been optimized
minimize the number of field multiplications in favor field squarings
since they are quite a bit faster.  They routines also now look for
certain assumptions such as z values of 1 or equivalent z values which
can be used to further reduce the number of multiplicaitons needed when
possible.

Note there are still quite a few more optimizations that could be done
such as using precomputation for ScalarBaseMult, making use of the
secp256k1 endomorphism, and using windowed NAF, however this work already
offers significant performance improvements.

For example, testing 10000 random signature verifications resulted in:
New btcec took 15.9821565s
Old btcec took 2m34.1016716s

Closes conformal/btcd#26.


  Commit: ac7e4de201765bdffbe807646514f2c0311d0618
      
https://github.com/conformal/btcec/commit/ac7e4de201765bdffbe807646514f2c0311d0618
  Author: Dave Collins <[email protected]>
  Date:   2013-12-20 (Fri, 20 Dec 2013)

  Changed paths:
    M btcec_test.go
    A field_test.go
    M internal_test.go
    M test_coverage.txt

  Log Message:
  -----------
  Add field and point addition/multiplicaiton tests.

This commit adds 100% test coverage for the new code.  This brings the
overall btcec coverage up to 99.76%.


Compare: https://github.com/conformal/btcec/compare/95b3c063e382...ac7e4de20176

Reply via email to