Custom fork of rust-secp256k1 with unsafe modifications for higher speed. Unsuitable for production.
Go to file
Andrew Poelstra 748dcd9401
Merge rust-bitcoin/rust-secp256k1#567: Upgrade the vendored `libsecp256k1` code to v0.2.0
2dad589394 Upgrade the vendored libsecp256k1 code (Tobin C. Harding)
2d4aacc4ad Update scratch_impl.h patch file (Tobin C. Harding)

Pull request description:

  This bumps `secp256k1` to v0.26.0 and `secp256k1-sys` to v0.8.0

  `libsecp256k1` v0.2.0 was just released.

  Update the vendored code using

   `./vendor-libsecp.sh depend 0_8_0 21ffe4b`

  ```
  git show 21ffe4b
  commit 21ffe4b22a9683cf24ae0763359e401d1284cc7a (tag: v0.2.0)
  Merge: 8c949f5 e025ccd
  Author: Pieter Wuille <pieter@wuille.net>
  Date:   Mon Dec 12 17:00:52 2022 -0500

      Merge bitcoin-core/secp256k1#1055: Prepare initial release

      e025ccdf7473702a76bb13d763dc096548ffefba release: prepare for initial release 0.2.0 (Jonas Nick)
      6d1784a2e2c1c5a8d89ffb08a7f76fa15e84fff5 build: add missing files to EXTRA_DIST (Jonas Nick)
      13bf1b6b324f2ed1c1fb4c8d17a4febd3556839e changelog: make order of change types match keepachangelog.com (Jonas Nick)
      b1f992a552785395d2e60b10862626fd11f66f84 doc: improve release process (Jonas Nick)
      ad39e2dc417f85c1577a6a6a9c519f5c60453def build: change package version to 0.1.0-dev (Jonas Nick)
      90618e9263ebc2a0d73d487d6d94fd3af96b973c doc: move CHANGELOG from doc/ to root directory (Jonas Nick)

      Pull request description:

        Based on #964

      ACKs for top commit:
        sipa:
          ACK e025ccdf7473702a76bb13d763dc096548ffefba

      Tree-SHA512: b9ab71d7362537d383a32b5e321ef44069f00e3e92340375bcd662267bc5a60c2bad60222998e6602cfac24ad65efb23d772eac37c86065036b90ef090b54c49
  ```

  Requires a new version of `secp256k1-sys`, use v0.8.0

  - Update the `secp256k1-sys` manifest (including links field)
  - Update symbols to use 0_8_0
  - Add a changelog entry
  - depend on the new version in `secp256k1`

  Which in turn requires a new version of `secp256k1`, use v0.26.0

ACKs for top commit:
  apoelstra:
    ACK 2dad589394

Tree-SHA512: 58eb5a276a78336e45b1473970f2d68dc2249b4a751deae44d70c2453cf5798b0edc0fdee2eabfb5707053e76e3a49849009b0c2f9dce08bd4bb5bb8d3549a62
2022-12-21 16:10:35 +00:00
.github/workflows Add formatting check to CI 2022-11-22 08:54:24 +11:00
contrib Merge rust-bitcoin/rust-secp256k1#526: Run the formatter in CI 2022-11-22 14:34:27 +00:00
examples Fix feature gating 2022-11-18 10:14:41 +11:00
githooks Add cargo fmt to pre-commit githook 2022-11-22 08:59:09 +11:00
no_std_test Remove call to deprecated methods 2022-03-01 18:07:36 +00:00
secp256k1-sys Upgrade the vendored libsecp256k1 code 2022-12-21 08:11:14 +11:00
src Remove unnecessary cast 2022-12-16 11:02:02 +11:00
tests Run cargo fmt 2022-11-16 11:06:12 +11:00
.gitignore Added ECMULT window size 2019-07-03 17:48:35 -04:00
CHANGELOG.md Upgrade the vendored libsecp256k1 code 2022-12-21 08:11:14 +11:00
Cargo.toml Upgrade the vendored libsecp256k1 code 2022-12-21 08:11:14 +11:00
LICENSE Remove the MIT/CC0 license in favor of just CC0 2015-03-25 18:36:30 -05:00
README.md Create configuration conditional bench 2022-07-14 09:35:23 +10:00
clippy.toml Update secp256k1 to edition 2018 and fix imports 2022-06-07 23:59:25 +03:00
rustfmt.toml Introduce rustfmt config file 2022-11-16 10:47:50 +11:00

README.md

Build Status

Full documentation

rust-secp256k1

rust-secp256k1 is a wrapper around libsecp256k1, a C library by Pieter Wuille for producing ECDSA signatures using the SECG curve secp256k1. This library

  • exposes type-safe Rust bindings for all libsecp256k1 functions
  • implements key generation
  • implements deterministic nonce generation via RFC6979
  • implements many unit tests, adding to those already present in libsecp256k1
  • makes no allocations (except in unit tests) for efficiency and use in freestanding implementations

Contributing

Contributions to this library are welcome. A few guidelines:

  • Any breaking changes must have an accompanied entry in CHANGELOG.md
  • No new dependencies, please.
  • No crypto should be implemented in Rust, with the possible exception of hash functions. Cryptographic contributions should be directed upstream to libsecp256k1.
  • This library should always compile with any combination of features on Rust 1.41.1.

Githooks

To assist devs in catching errors before running CI we provide some githooks. If you do not already have locally configured githooks you can use the ones in this repository by running, in the root directory of the repository:

git config --local core.hooksPath githooks/

Alternatively add symlinks in your .git/hooks directory to any of the githooks we provide.

Benchmarks

We use a custom Rust compiler configuration conditional to guard the bench mark code. To run the bench marks use: RUSTFLAGS='--cfg=bench' cargo +nightly bench --features=recovery.

Fuzzing

If you want to fuzz this library, or any library which depends on it, you will probably want to disable the actual cryptography, since fuzzers are unable to forge signatures and therefore won't test many interesting codepaths. To instead use a trivially-broken but fuzzer-accessible signature scheme, compile with --cfg=fuzzing in your RUSTFLAGS variable.

Note that cargo hfuzz sets this config flag automatically.