11 releases (breaking)

Uses old Rust 2015

0.9.1 Jan 4, 2024
0.8.1 Jul 18, 2023
0.7.0 Sep 29, 2022
0.6.0 Mar 28, 2022
0.1.0 Jun 3, 2019

#36 in #secp256k1

Download history 1358/week @ 2023-12-23 1727/week @ 2023-12-30 1708/week @ 2024-01-06 2124/week @ 2024-01-13 2583/week @ 2024-01-20 3243/week @ 2024-01-27 2486/week @ 2024-02-03 2813/week @ 2024-02-10 2145/week @ 2024-02-17 2198/week @ 2024-02-24 3084/week @ 2024-03-02 3256/week @ 2024-03-09 3595/week @ 2024-03-16 3835/week @ 2024-03-23 3404/week @ 2024-03-30 3801/week @ 2024-04-06

15,149 downloads per month
Used in 74 crates (via secp256k1-zkp)

CC0 license

4.5MB
38K SLoC

C 35K SLoC // 0.0% comments GNU Style Assembly 742 SLoC // 0.1% comments Rust 610 SLoC // 0.1% comments Python 370 SLoC // 0.4% comments Shell 249 SLoC // 0.1% comments Automake 229 SLoC // 0.0% comments M4 40 SLoC // 0.2% comments

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

secp256k1-zkp-sys

This crate provides Rust definitions for the FFI structures and methods.

Vendoring

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

This prefix ensures that no symbol collision can happen:

  • when a Rust project has two different versions of rust-secp256k1-zkp in its depepdency tree, or
  • when rust-secp256k1-zkp is used for building a static library in a context where existing libsecp256k1-zkp 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

For the more exotic use cases, this crate can be used with existing libsecp256k1-zkp symbols by using the external-symbols feature. How to setup rustc to link against those existing symbols is left as an exercise to the reader.

Minimum Supported Rust Version

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

Dependencies

~4.5MB
~41K SLoC