Skip to content

Commit 25512b3

Browse files
committed
revert ed25519 changes not used
1 parent c8bc897 commit 25512b3

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

bolos-mock/src/crypto/ecfp256.rs

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,7 @@ impl<const B: usize> SecretKey<B> {
114114
rand_chacha7::ChaCha8Rng::from_seed(seed)
115115
}
116116

117-
pub fn new(
118-
_: Mode,
119-
curve: Curve,
120-
path: BIP32Path<B>,
121-
ed25519_secret_key_bytes: Option<[u8; 32]>,
122-
) -> Self {
117+
pub fn new(_: Mode, curve: Curve, path: BIP32Path<B>) -> Self {
123118
let bytes = match curve {
124119
Curve::Secp256K1 => {
125120
let secret = k256::ecdsa::SigningKey::random(&mut Self::rng8(path));
@@ -132,17 +127,13 @@ impl<const B: usize> SecretKey<B> {
132127
*secret.to_bytes().as_ref()
133128
}
134129
Curve::Ed25519 => {
135-
if let Some(bytes) = ed25519_secret_key_bytes {
136-
let secret = ed25519_dalek::SigningKey::from_bytes(&bytes);
137-
secret.to_bytes()
138-
} else {
139-
// Generate random bytes using the path if no bytes provided
140-
let mut bytes = [0u8; 32];
141-
let mut rng = Self::rng8(path);
142-
use rand_chacha8::rand_core::RngCore;
143-
rng.fill_bytes(&mut bytes);
144-
bytes
145-
}
130+
use rand_chacha7::rand_core::RngCore;
131+
let mut rng = Self::rng7(path);
132+
let mut bytes = [0u8; 32];
133+
rng.fill_bytes(&mut bytes);
134+
let secret = ed25519_dalek::SigningKey::from_bytes(&bytes);
135+
136+
secret.to_bytes()
146137
}
147138
Curve::Stark256 => {
148139
panic!("invalid curve passed to ecfp256 new")

0 commit comments

Comments
 (0)