Registry / crypto / libsecp256k1

libsecp256k1

JSON →
library0.7.2rscratesunverified

Pure Rust implementation of secp256k1 elliptic curve operations.

# Cargo.toml [dependencies] libsecp256k1 = "0.7.2"
INSTALL
IMPORT
SIG · LIBSECP256K1
L
libsecp256k1
cryptorustv0.7.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SecretKey
use libsecp256k1::SecretKey;

Generates a secp256k1 key pair and signs/verifies a message.

use libsecp256k1::{SecretKey, PublicKey, Message, sign, verify}; use rand::rngs::OsRng; let sk = SecretKey::random(&mut OsRng); let pk = PublicKey::from_secret_key(&sk); let msg = Message::hash(b"hello"); let sig = sign(&msg, &sk); assert!(verify(&msg, &sig, &pk).is_ok());
Debug
Known issues
gotchaThis crate is a fork of paritytech/libsecp256k1; consider using `k256` for more features.
fix
Evaluate `k256` as a more actively maintained alternative.
affects: >=0.7.0
Upgrade
Version history
0.7.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
libsecp256k1 — cargo add libsecp256k1 · libregistry