substrate_crypto_light/
lib.rs

1//! This is largely based on
2//! [`sp_core`](https://docs.rs/sp-core/latest/sp_core/) crate. Draft.
3//!
4//! Key differences here:
5//!
6//! - no-std compatible with arm
7//! - sr25519 supports external Rng, for usability on baremetal
8//! - ecdsa support based on pure Rust crate `k256`, to avoid `no-std` target
9//!   compiling difficulties (original `sp-core` has ecdsa from `secp256k1`, a C
10//!   wrapper crate, and as a result ecdsa parts from `sp-core` do not compile on
11//!   certain `no-std` targets and create extremely large binary blob on others)
12//! - ecdsa pair has zeroize on drop
13
14#![no_std]
15#![deny(unused_crate_dependencies)]
16
17#[cfg(feature = "std")]
18#[macro_use]
19extern crate std;
20
21#[cfg(not(feature = "std"))]
22#[macro_use]
23extern crate alloc;
24
25#[cfg(not(feature = "std"))]
26extern crate core;
27
28pub mod common;
29#[cfg(feature = "ecdsa")]
30pub mod ecdsa;
31#[cfg(feature = "ed25519")]
32pub mod ed25519;
33pub mod error;
34#[cfg(feature = "sr25519")]
35pub mod sr25519;