Commit Graph

24 Commits

Author SHA1 Message Date
Andrew Poelstra d35168d626 [BREAKING CHANGE] Fix FFI 2015-11-15 17:00:07 -06:00
Andrew Poelstra 2df3c0b37c Minor changes for problems `cargo clippy` found 2015-10-28 07:48:28 -05:00
Andrew Poelstra a65f4cf01f Expose normalize_s function to convert signatures to low-S form 2015-10-26 14:25:18 -05:00
Andrew Poelstra 8e984c5912 Add "lax DER" support; bump major version number for recent build system changes 2015-10-26 12:59:40 -05:00
Andrew Poelstra e7ca836c2b Switch to static linking of secp256k1
Pieter moved some stuff I need into the contrib/ directory which does
not expose anything through the shared lib, so I need to statically
link.

I might also use this to do evil things to expose the SHA256 code
in libsecp, but not for now ;).
2015-10-26 10:28:01 -05:00
Andrew Poelstra f1e1da1213 Update for breaking changes in underlying rustc.
This should be a major version number since I changed public constants
in the ffi module. I'm not doing so as the invariant "will the constants
be meaningful to the underlying library" has not changed.

In general this library's version numbers do not map well to the
underlying library, which is as-yet not versioned at all, so users
need to always be running "the lastest" rust-secp256k1 anyway, and
semantic versioning can't really be used meaninfully. So this is a
bit of a judgement call.
2015-10-25 18:26:08 -05:00
Andrew Poelstra ec0e8407f2 Minor documentation fixes 2015-10-09 11:39:42 -05:00
Andrew Poelstra 4012281a2d Fix for upstream API changes 2015-09-20 14:52:29 -05:00
Andrew Poelstra cc68cf8b9e Update serde dep to 0.6 from 0.3 2015-09-20 13:29:09 -05:00
Andrew Poelstra 016d781f2e Fix for upstream API changes; add ECDH support
I didn't mean for both of these to go into the same commit, but given how
small the ECDH code was, and the fact that no commit prior to this one will
compile (as both libsecp256k1 and rustc have changed so much), I'm letting
it slide.
2015-09-18 15:40:42 -05:00
Andrew Poelstra 8d6f384dac Update Travis to use travis-cargo 2015-07-28 13:21:12 -05:00
Andrew Poelstra 77f6b6bf21 [API BREAK] Update for new libsecp256k1 API 2015-07-28 11:05:13 -05:00
Andrew Poelstra 5602d6f988 Expose `secp256k1_context_randomize`
This is a new libsecp256k1 function which does additive blinding
for nonce generation during signing.
2015-05-03 18:22:30 -05:00
Andrew Poelstra d7c7230f28 Impl `Send` and `Sync` for secp256k1 contexts 2015-04-13 20:41:24 -05:00
Andrew Poelstra 9a01401746 Add missing implementations; update FFI for libsecp256k1's new cloning fn 2015-04-12 09:36:49 -05:00
Andrew Poelstra e52faee98f [API BREAK] update for libsecp256k1 "explicit context" API break
Rather than have global initialization functions, which required
expensive synchronization on the part of the Rust library,
libsecp256k1 now carries its context in thread-local data which
must be passed to every function.

What this means for the rust-secp256k1 API is:
  - Most functions on `PublicKey` and `SecretKey` now require a
    `Secp256k1` to be given to them.

  - `Secp256k1::verify` and `::verify_raw` now take a `&self`

  - `SecretKey::new` now takes a `Secp256k1` rather than a Rng; a
    future commit will allow specifying the Rng in the `Secp256k1`
    so that functionality is not lost.

  - The FFI functions have all changed to take a context argument

  - `secp256k1::init()` is gone, as is the dependency on std::sync

  - There is a `ffi::Context` type which must be handled carefully
    by anyone using it directly (hopefully nobody :))
2015-04-11 12:52:54 -05:00
Andrew Poelstra 1591bba3f9 Update bindings to current secp256k1 library
rust-secp256k1 was based off of https://github.com/sipa/secp256k1,
which has been inactive nearly as long as this repository (prior to
a couple days ago anyway). The correct repository is

   https://github.com/bitcoin/secp256k1

This is a major breaking change to the library for one reason: there
are no longer any Nonce types in the safe interface. The signing functions
do not take a nonce; this is generated internally.

This also means that I was able to drop all my RFC6979 code, since
libsecp256k1 has its own implementation.

If you need to generate your own nonces, you need to create an unsafe
function of type `ffi::NonceFn`, then pass it to the appropriate
functions in the `ffi` module. There is no safe interface for doing
this, deliberately: there is basically no need to directly fiddle
with nonces ever.
2015-04-06 00:13:38 -05:00
Andrew Poelstra 5a6c6c8d0a Fix for secp256k1 ffi changes
All tests pass, compile now
2015-01-17 10:38:16 -06:00
Andrew Poelstra 059c72aa60 Do validation in pubkey::from_slice 2014-08-31 16:04:14 -05:00
Andrew Poelstra a5951eff47 Expose tweak functions in FFI, wrap a couple 2014-08-28 09:16:53 -07:00
Andrew Poelstra 83f2ccf5d7 Add verification to SecretKey::from_slice() 2014-08-24 16:13:08 -07:00
Andrew Poelstra db37829904 Add CC0 license and header to all files 2014-08-11 19:26:45 -07:00
Andrew Poelstra 5b15918a9a Move FFI and constants into their own modules; replace outptrs with returns 2014-08-11 19:24:19 -07:00
Andrew Poelstra 448f4829e7 Move FFI functions into separate module; add documentation and style lints 2014-08-11 19:24:19 -07:00