Commit graph

6 commits

Author SHA1 Message Date
Steven Roose
79445fbd97 btcec: Prevent static initialization of S256
This is achieved by introducing a new variable `halfOrder` on the
KoblitzCurve struct that is half the order.
2017-10-13 03:37:29 -05:00
Jimmy Song
1bdb713285 btcec: Slightly optimize NAF and add several tests.
This slightly optimizes the NAF function by avoiding returning the
unused bit when there is not a carry.

It also adds a bunch of additional unit tests which I made while
debugging.
2017-06-07 20:43:48 -05:00
Dave Collins
6e402deb35 Relicense to the btcsuite developers.
This commit relicenses all code in this repository to the btcsuite
developers.
2015-05-01 12:00:56 -05:00
Dave Collins
2713c8528d Consistency and general cleanup in btcec.
This commit contains various modifications for code and comment
consistency in the btcec package:
- Call out references at the top and reference them by their identifier in
  the other comments
- Remove a TODO that no longer applies
- Add comments to the fields in the KoblitzCurve struct and reorder them
  slightly
- Make comments wrap to 80
- Cleanup code that was far exceeding col 80 (only function declarations
  typically do this)
- Extend block comments to use as much of the 80 cols as available
- Add a bit more explanation in a couple of places
- Update copyright year on secp256k1.go
- Fix a couple of typos in the comments
2015-02-06 16:55:34 -06:00
Dave Collins
555778e9d5 Don't ignore errs setting consts in btcec init.
This commit converts the initialization of the constants to use a function
which panics on error instead of just ignoring the error.  This is
acceptable since they are hard-coded constants and should never fail.
2015-02-06 12:57:06 -06:00
Dave Collins
87968edb1d Import btcec repo into btcec directory. 2015-02-06 10:09:24 -06:00
Renamed from btcec.go (Browse further)