A convenience wrapper around cryptography libraries for LIT Protocol. This crate consolidates all elliptic curve libraries used by LIT projects to keep versioning consistent across the ecosystem.
| Curve | Crate | Description |
|---|---|---|
| BLS12-381 | bls12_381_plus, blsful, blstrs_plus |
Pairing-friendly curve for BLS signatures |
| Curve25519 | curve25519-dalek-ml |
Fast curve for Ed25519/X25519 |
| Decaf377 | decaf377_plus |
Ristretto group over BLS12-377 |
| Ed448-Goldilocks | ed448-goldilocks-plus |
High-security curve (448-bit) |
| JubJub | jubjub-plus |
Embedded curve over BLS12-381 |
| secp256k1 | k256 |
Bitcoin/Ethereum curve |
| P-256 | p256 |
NIST P-256 curve |
| P-384 | p384 |
NIST P-384 curve |
| Pasta | pasta_curves_plus |
Pallas and Vesta curves for recursive SNARKs |
Add to your Cargo.toml:
[dependencies]
lit-rust-crypto = "0.6"Or with specific features:
[dependencies]
lit-rust-crypto = { version = "0.6", default-features = false, features = ["k256", "p256"] }The crate re-exports all curve libraries at the top level:
use lit_rust_crypto::{k256, p256, elliptic_curve};
// Use secp256k1
use lit_rust_crypto::k256::ecdsa::{SigningKey, Signature};
// Use P-256
use lit_rust_crypto::p256::SecretKey;
// Access common traits
use lit_rust_crypto::group::Group;
use lit_rust_crypto::ff::Field;use lit_rust_crypto::blsful;
// BLS signature operations via blsfuluse lit_rust_crypto::vsss_rs;
// Shamir secret sharing and moreEnable only the curves you need:
| Feature | Description |
|---|---|
blst |
BLS12-381 via blst backend |
rust |
Pure Rust BLS12-381 implementation |
curve25519-dalek |
Curve25519 support |
decaf377 |
Decaf377 curve |
ed448-goldilocks |
Ed448-Goldilocks curve |
jubjub |
JubJub curve |
k256 |
secp256k1 curve |
p256 |
NIST P-256 curve |
p384 |
NIST P-384 curve |
pasta |
Pallas and Vesta curves |
vsss-rs |
Verifiable secret sharing |
| Feature | Description |
|---|---|
alloc |
Enable alloc support (no_std compatible) |
std |
Enable std support |
arithmetic |
Field/group arithmetic operations |
bits |
Bit manipulation support |
digest |
Hash digest integration |
ecdh |
Elliptic curve Diffie-Hellman |
ecdsa |
ECDSA signatures |
hash2curve |
Hash-to-curve support |
jwk |
JSON Web Key support |
pkcs8 |
PKCS#8 key encoding |
pem |
PEM encoding support |
schnorr |
Schnorr signatures (k256 only) |
serde |
Serialization support |
zeroize |
Secure memory zeroing |
The default feature set includes common curves and functionality:
blsful/defaultblstcurve25519-dalek/defaultdecaf377/defaulted448-goldilocks/defaultelliptic-curve/defaultjubjub/defaultk256/defaultp256/defaultp384/defaultpasta/defaultvsss-rs/default
This crate supports no_std environments. Disable default features and enable only what you need:
[dependencies]
lit-rust-crypto = { version = "0.6", default-features = false, features = ["k256", "alloc"] }Licensed under either of:
at your option.
Contributions are welcome! Please see the repository for more information.