Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 7 additions & 82 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ blst = "0.3.15"
bn = { package = "substrate-bn", version = "0.6", default-features = false }
c-kzg = { version = "2.1.1", default-features = false }
k256 = { version = "0.13.4", default-features = false }
libsecp256k1 = { version = "0.7", default-features = false }
secp256k1 = { version = "0.31.1", default-features = false }
sha2 = { version = "0.10.9", default-features = false }
ripemd = { version = "0.1.3", default-features = false }
Expand Down
5 changes: 0 additions & 5 deletions crates/precompile/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ secp256k1 = { workspace = true, features = [
"rand",
"global-context",
], optional = true }
libsecp256k1 = { workspace = true, features = [
"static-context",
], optional = true }

# SHA2-256 and RIPEMD-160
sha2.workspace = true
Expand Down Expand Up @@ -85,7 +82,6 @@ std = [
"sha2/std",
"c-kzg?/std",
"secp256k1?/std",
"libsecp256k1?/std",
"ark-bn254/std",
"ark-bls12-381/std",
"aurora-engine-modexp/std",
Expand All @@ -112,7 +108,6 @@ portable = ["c-kzg?/portable", "blst?/portable"]
# The problem that `secp256k1` has is it fails to build for `wasm` target on Windows and Mac as it is c lib.
# In Linux it passes. If you don't require to build wasm on win/mac, it is safe to use it and it is enabled by default.
secp256k1 = ["dep:secp256k1"]
libsecp256k1 = ["dep:libsecp256k1"]

# Enables the blst implementation of the BLS12-381 precompile.
blst = ["dep:blst"]
Expand Down
9 changes: 2 additions & 7 deletions crates/precompile/src/secp256k1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
//! * [`k256`](https://crates.io/crates/k256) - uses maintained pure rust lib `k256`, it is perfect use for no_std environments.
//! * [`secp256k1`](https://crates.io/crates/secp256k1) - uses `bitcoin_secp256k1` lib, it is a C implementation of secp256k1 used in bitcoin core.
//! It is faster than k256 and enabled by default and in std environment.
//! * [`libsecp256k1`](https://crates.io/crates/libsecp256k1) - is made from parity in pure rust, it is alternative for k256.
//!
//! Order of preference is `secp256k1` -> `k256` -> `libsecp256k1`. Where if no features are enabled, it will use `k256`.

//! Order of preference is `secp256k1` -> `k256`. Where if no features are enabled, it will use `k256`.
//!
//! Input format:
//! [32 bytes for message][64 bytes for signature][1 byte for recovery id]
Expand All @@ -16,8 +15,6 @@
#[cfg(feature = "secp256k1")]
pub mod bitcoin_secp256k1;
pub mod k256;
#[cfg(feature = "libsecp256k1")]
pub mod parity_libsecp256k1;

use crate::{
crypto, utilities::right_pad, Precompile, PrecompileError, PrecompileId, PrecompileOutput,
Expand Down Expand Up @@ -70,8 +67,6 @@ pub(crate) fn ecrecover_bytes(sig: [u8; 64], recid: u8, msg: [u8; 32]) -> Option
cfg_if::cfg_if! {
if #[cfg(feature = "secp256k1")] {
pub use bitcoin_secp256k1::ecrecover;
} else if #[cfg(feature = "libsecp256k1")] {
pub use parity_libsecp256k1::ecrecover;
} else {
pub use k256::ecrecover;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/precompile/src/secp256k1/bitcoin_secp256k1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use k256 as _;

/// Recover the public key from a signature and a message.
///
/// This function is using the `secp256k1` crate, it is enabled by `libsecp256k1` feature and it is in default.
/// This function is using the `secp256k1` crate, it is enabled by `secp256k1` feature and it is in default.
pub fn ecrecover(sig: &B512, recid: u8, msg: &B256) -> Result<B256, secp256k1::Error> {
let recid = RecoveryId::try_from(recid as i32).expect("recovery ID is valid");
let sig = RecoverableSignature::from_compact(sig.as_slice(), recid)?;
Expand Down
19 changes: 0 additions & 19 deletions crates/precompile/src/secp256k1/parity_libsecp256k1.rs

This file was deleted.

Loading