Skip to content
This repository was archived by the owner on Nov 20, 2023. It is now read-only.

Commit 17432cb

Browse files
authored
Update ed25519 library (#4)
* Update ed25519 library * Version bump
1 parent 93202d6 commit 17432cb

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "enr"
33
authors = ["Age Manning <[email protected]>"]
44
edition = "2018"
5-
version = "0.1.0"
5+
version = "0.1.1"
66
description = "Rust implementation of Ethereum Node Record (ENR) EIP778"
77
readme = "./README.md"
88
keywords = ["ethereum", "enr", "record", "EIP778", "node"]
@@ -25,7 +25,7 @@ tiny-keccak = { version = "2.0.2", features = ["keccak"] }
2525
zeroize = "1.1.0"
2626
libsecp256k1 = { version = "0.3.5", optional = true }
2727
serde = { version = "1.0.110", optional = true }
28-
ed25519-dalek = { version = "1.0.0-pre.3", optional = true }
28+
ed25519-dalek = { version = "1.0.0-pre.4", optional = true }
2929
c-secp256k1 = { package = "secp256k1", version = "0.17.2", optional = true }
3030

3131
[dev-dependencies]

src/keys/ed25519.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
use super::{ed25519_dalek as ed25519, EnrKey, EnrPublicKey, SigningError};
1+
use super::ed25519_dalek::{self as ed25519, Signer as _, Verifier as _};
2+
use super::{EnrKey, EnrPublicKey, SigningError};
23
use rlp::DecoderError;
34
use std::collections::BTreeMap;
5+
use std::convert::TryFrom;
46

57
/// The ENR key that stores the public key in the ENR record.
68
pub const ENR_KEY: &str = "ed25519";
@@ -35,7 +37,7 @@ impl EnrKey for ed25519::Keypair {
3537
impl EnrPublicKey for ed25519::PublicKey {
3638
/// Verify a raw message, given a public key for the v4 identity scheme.
3739
fn verify_v4(&self, msg: &[u8], sig: &[u8]) -> bool {
38-
ed25519::Signature::from_bytes(sig)
40+
ed25519::Signature::try_from(sig)
3941
.and_then(|s| self.verify(msg, &s))
4042
.is_ok()
4143
}

0 commit comments

Comments
 (0)