Commit graph

15 commits

Author SHA1 Message Date
Owain G. Ainsworth
d0a4086e29 Add an api to get a pubkey and privkey from a privkey byte string.
ok and some tweaks from @jrick.
2014-03-25 15:10:58 +00:00
Owain G. Ainsworth
ff3fac426d Add code to produce and verify compact signatures.
The format used is identical to that used in bitcoind.
2014-02-13 18:47:10 +00:00
Dave Collins
218906a91e Make the race detect happy.
Since the Z values are normalized (which ordinarily mutates them as
needed) before checking for equality, the race detector gets confused when
using a global value for the field representation of the value 1 and
passing it into the various internal arithmetic routines and reports a
false positive.

Even though the race was a false positive and had no adverse effects, this
commit silences the race detector by creating new variables at the top
level and passing them instead of the global fieldOne variable.  The
global is still used for comparison operations since those have no
potential to mutate the value and hence don't trigger the race detector.
2014-02-13 10:59:14 -06:00
Dave Collins
cc712827da Add tests for pad function.
This brings the overall test coverage up to 99.88%.
2013-12-28 15:30:10 -06:00
Dave Collins
bb6b277706 Add tests for new Signature.Serialize function.
This is part of the resolution for issue btcscript/#3.
2013-12-23 11:31:26 -06:00
Dave Collins
ac7e4de201 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%.
2013-12-20 15:09:58 -06:00
Josh Rickmar
98ac46b37d Add ParseDERSignature.
This change adds an additional signature parsing function which
performs additional checks to verify the signature is serialized in a
valid DER (and thus, unique) format, instead of allowing the less
strict BER signatures that ParseSignature will happily accept.

Added additional tests and updated test coverage to reflect changes.
2013-10-25 15:09:48 -04:00
Josh Rickmar
961636c764 Add functions to serialize an ecdsa public key. 2013-09-30 18:18:03 -04:00
Owain G. Ainsworth
031437decf test 0 length numbers (disallowed) and coordinates of 0 (also) 2013-06-18 00:17:32 +01:00
Owain G. Ainsworth
13cf6091e6 Test the sanity checks for numbers too big for the curve fire correctly. 2013-06-17 23:58:47 +01:00
Owain G. Ainsworth
316faf034c update test coverage stats. 2013-06-17 17:41:37 +01:00
Owain G. Ainsworth
9cb1f47fb9 add signature test harness and try a valid signature for size.
error paths to come.
2013-06-14 01:11:06 +01:00
Owain G. Ainsworth
7cfebed976 Test the ``parameter is >= P'' pubkey error paths. 2013-06-14 00:28:54 +01:00
Owain G. Ainsworth
9638528b8e test hybrid keys too.
Nothing that I know of uses them, but if we have the code path we should
be pretty sure it works.
2013-06-14 00:06:25 +01:00
Dave Collins
6e9cc57131 Initial implementation. 2013-06-13 14:38:54 -05:00