19 unstable releases

0.10.1 Sep 11, 2024
0.10.0 Apr 2, 2024
0.9.2 Jan 3, 2024
0.9.1 Dec 6, 2023
0.1.1 Dec 11, 2019

#405 in Cryptography

Download history 184205/week @ 2024-08-23 193543/week @ 2024-08-30 190595/week @ 2024-09-06 185653/week @ 2024-09-13 197246/week @ 2024-09-20 189539/week @ 2024-09-27 217444/week @ 2024-10-04 209013/week @ 2024-10-11 218885/week @ 2024-10-18 203116/week @ 2024-10-25 192735/week @ 2024-11-01 202050/week @ 2024-11-08 218375/week @ 2024-11-15 204157/week @ 2024-11-22 207433/week @ 2024-11-29 196598/week @ 2024-12-06

865,290 downloads per month
Used in 1,945 crates (5 directly)

CC0 license

4.5MB
38K SLoC

C 35K SLoC // 0.0% comments Rust 1.5K SLoC // 0.0% comments GNU Style Assembly 754 SLoC // 0.1% comments Shell 254 SLoC // 0.1% comments Automake 226 SLoC // 0.1% comments Python 75 SLoC // 0.2% comments M4 61 SLoC // 0.1% comments

Contains (obscure autoconf code, 20KB) depend/secp256k1/configure.ac

Rust secp256k1-sys

Crate Info CC0 1.0 Universal Licensed API Docs Rustc Version 1.56.1+

Provides low-level bindings to the C FFI exposed by libsecp256k1.

Vendoring

The default build process is to build using the vendored libsecp256k1 sources in the depend directory. These sources are prefixed with a special rust-secp256k1-sys-specific prefix rustsecp256k1_v1_2_3_.

This prefix ensures that no symbol collision can happen:

  • When a Rust project has two different versions of rust-secp256k1 in its depepdency tree, or
  • When rust-secp256k1 is used for building a static library in a context where existing libsecp256k1 symbols are already linked.

To update the vendored sources, use the vendor-libsecp.sh script: ./vendor-libsecp.sh <rev>

  • Where <rev> is the git revision of libsecp256k1 to checkout. If you do not specify a revision, the script will simply clone the repo and use whatever revision the default branch is pointing to.

Linking to external symbols

Danger: doing this incorrectly may have catastrophic consequences!

This is mainly intended for applications consisting of various programming languages that intend to link the same library to save space, or bundles of multiple binaries coming from the same source. Do not use this to link to a random secp256k1 library you found in your OS! If you are packaging software that depends on rust-secp256k1, using this flag to link to another package, make sure you stay within the binary compatibility guarantees of that package. For example, in Debian if you need libsecp256k1 1.2.3, make sure your package requires a version strictly>= 1.2.3 << 1.2.4. Note also that unless you're packaging the library for an official repository you should prefix your package and the library with a string specific to you. E.g. if you have a set of packages called my-awesome-packages you should package libsecp256k1 as libmy-awesome-packages-secp256k1 and depend on that library/package name from your application.

If you want to compile this library without using the bundled symbols (which may be required for integration into other build systems), you can do so by adding --cfg=rust_secp_no_symbol_renaming' to your RUSTFLAGS variable.

Minimum Supported Rust Version

This library should always compile with any combination of features on Rust 1.56.1.

Dependencies