mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
chore(ecies): replace reth-primitives with alloy-primitives (#8812)
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -6834,6 +6834,7 @@ name = "reth-ecies"
|
|||||||
version = "1.0.0-rc.1"
|
version = "1.0.0-rc.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes 0.8.4",
|
"aes 0.8.4",
|
||||||
|
"alloy-primitives",
|
||||||
"alloy-rlp",
|
"alloy-rlp",
|
||||||
"block-padding",
|
"block-padding",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
@ -6847,7 +6848,6 @@ dependencies = [
|
|||||||
"pin-project",
|
"pin-project",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"reth-network-peers",
|
"reth-network-peers",
|
||||||
"reth-primitives",
|
|
||||||
"secp256k1 0.28.2",
|
"secp256k1 0.28.2",
|
||||||
"sha2 0.10.8",
|
"sha2 0.10.8",
|
||||||
"sha3",
|
"sha3",
|
||||||
|
|||||||
@ -11,13 +11,14 @@ repository.workspace = true
|
|||||||
workspace = true
|
workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
reth-primitives.workspace = true
|
|
||||||
reth-network-peers = { workspace = true, features = ["secp256k1"] }
|
reth-network-peers = { workspace = true, features = ["secp256k1"] }
|
||||||
|
|
||||||
alloy-rlp = { workspace = true, features = ["derive"] }
|
alloy-primitives = { workspace = true, features = ["rand", "rlp"] }
|
||||||
|
alloy-rlp = { workspace = true, features = ["derive", "arrayvec"] }
|
||||||
|
|
||||||
futures.workspace = true
|
futures.workspace = true
|
||||||
thiserror.workspace = true
|
thiserror.workspace = true
|
||||||
tokio = { workspace = true, features = ["full"] }
|
tokio = { workspace = true, features = ["time"] }
|
||||||
tokio-stream.workspace = true
|
tokio-stream.workspace = true
|
||||||
tokio-util = { workspace = true, features = ["codec"] }
|
tokio-util = { workspace = true, features = ["codec"] }
|
||||||
pin-project.workspace = true
|
pin-project.workspace = true
|
||||||
|
|||||||
@ -7,16 +7,16 @@ use crate::{
|
|||||||
ECIESError,
|
ECIESError,
|
||||||
};
|
};
|
||||||
use aes::{cipher::StreamCipher, Aes128, Aes256};
|
use aes::{cipher::StreamCipher, Aes128, Aes256};
|
||||||
|
use alloy_primitives::{
|
||||||
|
bytes::{BufMut, Bytes, BytesMut},
|
||||||
|
B128, B256, B512 as PeerId,
|
||||||
|
};
|
||||||
use alloy_rlp::{Encodable, Rlp, RlpEncodable, RlpMaxEncodedLen};
|
use alloy_rlp::{Encodable, Rlp, RlpEncodable, RlpMaxEncodedLen};
|
||||||
use byteorder::{BigEndian, ByteOrder, ReadBytesExt};
|
use byteorder::{BigEndian, ByteOrder, ReadBytesExt};
|
||||||
use ctr::Ctr64BE;
|
use ctr::Ctr64BE;
|
||||||
use digest::{crypto_common::KeyIvInit, Digest};
|
use digest::{crypto_common::KeyIvInit, Digest};
|
||||||
use rand::{thread_rng, Rng};
|
use rand::{thread_rng, Rng};
|
||||||
use reth_network_peers::{id2pk, pk2id};
|
use reth_network_peers::{id2pk, pk2id};
|
||||||
use reth_primitives::{
|
|
||||||
bytes::{BufMut, Bytes, BytesMut},
|
|
||||||
B128, B256, B512 as PeerId,
|
|
||||||
};
|
|
||||||
use secp256k1::{
|
use secp256k1::{
|
||||||
ecdsa::{RecoverableSignature, RecoveryId},
|
ecdsa::{RecoverableSignature, RecoveryId},
|
||||||
PublicKey, SecretKey, SECP256K1,
|
PublicKey, SecretKey, SECP256K1,
|
||||||
@ -735,7 +735,7 @@ impl ECIES {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use reth_primitives::{b256, hex};
|
use alloy_primitives::{b256, hex};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn ecdh() {
|
fn ecdh() {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
use crate::{algorithm::ECIES, ECIESError, EgressECIESValue, IngressECIESValue};
|
use crate::{algorithm::ECIES, ECIESError, EgressECIESValue, IngressECIESValue};
|
||||||
use reth_primitives::{BytesMut, B512 as PeerId};
|
use alloy_primitives::{bytes::BytesMut, B512 as PeerId};
|
||||||
use secp256k1::SecretKey;
|
use secp256k1::SecretKey;
|
||||||
use std::{fmt::Debug, io};
|
use std::{fmt::Debug, io};
|
||||||
use tokio_util::codec::{Decoder, Encoder};
|
use tokio_util::codec::{Decoder, Encoder};
|
||||||
|
|||||||
@ -18,7 +18,7 @@ pub use error::ECIESError;
|
|||||||
|
|
||||||
mod codec;
|
mod codec;
|
||||||
|
|
||||||
use reth_primitives::{
|
use alloy_primitives::{
|
||||||
bytes::{Bytes, BytesMut},
|
bytes::{Bytes, BytesMut},
|
||||||
B512 as PeerId,
|
B512 as PeerId,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -10,11 +10,11 @@
|
|||||||
//! For more information, refer to the [Ethereum MAC specification](https://github.com/ethereum/devp2p/blob/master/rlpx.md#mac).
|
//! For more information, refer to the [Ethereum MAC specification](https://github.com/ethereum/devp2p/blob/master/rlpx.md#mac).
|
||||||
|
|
||||||
use aes::Aes256Enc;
|
use aes::Aes256Enc;
|
||||||
|
use alloy_primitives::{B128, B256};
|
||||||
use block_padding::NoPadding;
|
use block_padding::NoPadding;
|
||||||
use cipher::BlockEncrypt;
|
use cipher::BlockEncrypt;
|
||||||
use digest::KeyInit;
|
use digest::KeyInit;
|
||||||
use generic_array::GenericArray;
|
use generic_array::GenericArray;
|
||||||
use reth_primitives::{B128, B256};
|
|
||||||
use sha3::{Digest, Keccak256};
|
use sha3::{Digest, Keccak256};
|
||||||
use typenum::U16;
|
use typenum::U16;
|
||||||
|
|
||||||
|
|||||||
@ -3,11 +3,11 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
codec::ECIESCodec, error::ECIESErrorImpl, ECIESError, EgressECIESValue, IngressECIESValue,
|
codec::ECIESCodec, error::ECIESErrorImpl, ECIESError, EgressECIESValue, IngressECIESValue,
|
||||||
};
|
};
|
||||||
use futures::{ready, Sink, SinkExt};
|
use alloy_primitives::{
|
||||||
use reth_primitives::{
|
|
||||||
bytes::{Bytes, BytesMut},
|
bytes::{Bytes, BytesMut},
|
||||||
B512 as PeerId,
|
B512 as PeerId,
|
||||||
};
|
};
|
||||||
|
use futures::{ready, Sink, SinkExt};
|
||||||
use secp256k1::SecretKey;
|
use secp256k1::SecretKey;
|
||||||
use std::{
|
use std::{
|
||||||
fmt::Debug,
|
fmt::Debug,
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
//! Utility functions for hashing and encoding.
|
//! Utility functions for hashing and encoding.
|
||||||
|
|
||||||
|
use alloy_primitives::B256;
|
||||||
use hmac::{Hmac, Mac};
|
use hmac::{Hmac, Mac};
|
||||||
use reth_primitives::B256;
|
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
|
|
||||||
/// Hashes the input data with SHA256.
|
/// Hashes the input data with SHA256.
|
||||||
|
|||||||
Reference in New Issue
Block a user