Commit Graph

16 Commits

Author SHA1 Message Date
Andrew Poelstra 77f6b6bf21 [API BREAK] Update for new libsecp256k1 API 2015-07-28 11:05:13 -05:00
Andrew Poelstra 96e1844c25 Change inline assertions to debug_asserts
All of these were things that are (should be) guaranteed true no matter
what input is given to the API, barring unsafe operations on the data.
2015-04-11 13:07:43 -05:00
Andrew Poelstra ac61baf040 Add support for serde (de)serialization; add unit tests 2015-04-10 00:32:12 -05:00
Andrew Poelstra f6585616b1 Add `Display` impl to `Error`; cleanup `Result` mess 2015-04-05 20:27:43 -05:00
Andrew Poelstra 5b3858e0ce Simplify Index implementations 2015-04-05 12:16:56 -05:00
Andrew Poelstra e2daaf875d Update for language changes (rustc beta is out !!) 2015-04-04 12:20:38 -05:00
Andrew Poelstra d858d7f7e6 Slicing fixes 2015-03-25 20:36:57 -05:00
Andrew Poelstra 825e77519f for in range(a,b) -> for in a..b 2015-03-25 14:42:05 -05:00
Andrew Poelstra d0519f0b3a IoResult -> io::Result, copy_nonoverlapping_memory -> copy_nonoverlapping 2015-03-25 14:10:02 -05:00
Andrew Poelstra d495d9ca06 Update for rustc changes
We can compile now, but not link -- there have been too many changes
in libsecp256k1 behind the scenes. Next commit :)
2015-01-17 10:13:45 -06:00
Andrew Poelstra 9cab4e023d Revert "Overhaul interface to use zero-on-free SecretKeys"
This reverts commit 9889090784.

This is not ready for primetime -- the move prevention also prevents
reborrowing, which makes secret keys nearly unusable.
2014-09-12 08:28:35 -05:00
Andrew Poelstra 9889090784 Overhaul interface to use zero-on-free SecretKeys
Using the `secretdata` library, we can store SecretKeys in such a way
that they cannot be moved or copied, and their memory is zeroed out on
drop. This gives us some assurance that in the case of memory unsafety,
there is not secret key data lying around anywhere that we don't expect.

Unfortunately, it means that we cannot construct secret keys and then
return them, which forces the interface to change a fair bit. I removed
the `generate_keypair` function from Secp256k1, then `generate_nonce`
for symmetry, then dropped the `Secp256k1` struct entirely because it
turned out that none of the remaining functions used the `self` param.

So here we are. I bumped the version number. Sorry about this.
2014-09-12 08:28:26 -05:00
Andrew Poelstra eabe57e403 Also make PublicKey encodable 2014-09-04 20:21:09 -05:00
Andrew Poelstra 71312b032a Impl encodable/decodable for the array newtypes 2014-09-04 20:09:18 -05:00
Andrew Poelstra 17daebf15d Implement deterministic nonce generation with HMAC-SHA512
Testing was done against python-ecdsa; python code in the test case
comments.
2014-09-04 16:21:35 -05:00
Andrew Poelstra a0f11d0f92 Travis speaks rust now :D 2014-08-27 10:58:24 -07:00