#secp256k1 #api-bindings #crypto

bin+lib p256k1

Rust wrappers around libsecp256k1 which expose internal scalar and point APIs

22 stable releases (6 major)

7.1.0 Mar 22, 2024
6.0.0 Nov 28, 2023
5.5.0 Oct 5, 2023
5.3.0 Jun 28, 2023
1.0.4 Feb 14, 2023

#366 in Cryptography

Download history 329/week @ 2023-12-21 296/week @ 2023-12-28 299/week @ 2024-01-04 348/week @ 2024-01-11 849/week @ 2024-01-18 1065/week @ 2024-01-25 1672/week @ 2024-02-01 1391/week @ 2024-02-08 966/week @ 2024-02-15 641/week @ 2024-02-22 1621/week @ 2024-02-29 963/week @ 2024-03-07 1374/week @ 2024-03-14 1323/week @ 2024-03-21 904/week @ 2024-03-28 988/week @ 2024-04-04

4,776 downloads per month
Used in 12 crates (3 directly)

Apache-2.0

4.5MB
45K SLoC

C 35K SLoC // 0.0% comments Rust 9K SLoC // 0.0% comments GNU Style Assembly 744 SLoC // 0.1% comments Automake 209 SLoC // 0.1% comments Shell 85 SLoC // 0.2% comments M4 42 SLoC // 0.2% comments

Contains (obscure autoconf code, 19KB) _secp256k1/configure.ac

p256k1

Rust wrappers around libsecp256k1 to expose unwrapped points and scalars with multi-exponentiation

p256k1 is a library providing group operations on secp256k1, a prime order Weierstrass curve.

p256k1 provides access to curve points in Jacobian coordinates, which allows for very fast operations. Standard math operators are implemented to allow writing code which closely resembles the underlying math. The BitXor operator is used for scalar exponentiation, using a fast square and multiply algorithm; this provides a very natural and intuitive API. Fast multi-exponentiation is provided using the standard Pippenger algorithm.

Dependencies

Stable rust with a working cargo. Also need llvm to build secp256k1 and link the wrappers.

Ubuntu

$ apt install llvm

MacOS with brew

After installing llvm, be sure to follow the instructions on updating .zshrc so llvm can be used by the build system.

$ brew install llvm

Dependencies

~2.1–5MB
~90K SLoC