mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-28 09:11:34 +00:00
Upgrade ed25519-dalek to pre.4 (#1665)
* Upgrade ed25519-dalek to pre.4 * Update core/src/identity/ed25519.rs Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com> Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
# 0.20.1 [2020-17-17]
|
||||||
|
|
||||||
|
- Update ed25519-dalek dependency.
|
||||||
|
|
||||||
# 0.20.0 [2020-07-01]
|
# 0.20.0 [2020-07-01]
|
||||||
|
|
||||||
- Conditional compilation fixes for the `wasm32-wasi` target
|
- Conditional compilation fixes for the `wasm32-wasi` target
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "libp2p-core"
|
name = "libp2p-core"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
description = "Core traits and structs of libp2p"
|
description = "Core traits and structs of libp2p"
|
||||||
version = "0.20.0"
|
version = "0.20.1"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://github.com/libp2p/rust-libp2p"
|
repository = "https://github.com/libp2p/rust-libp2p"
|
||||||
@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
asn1_der = "0.6.1"
|
asn1_der = "0.6.1"
|
||||||
bs58 = "0.3.0"
|
bs58 = "0.3.0"
|
||||||
ed25519-dalek = "1.0.0-pre.3"
|
ed25519-dalek = "1.0.0-pre.4"
|
||||||
either = "1.5"
|
either = "1.5"
|
||||||
fnv = "1.0"
|
fnv = "1.0"
|
||||||
futures = { version = "0.3.1", features = ["executor", "thread-pool"] }
|
futures = { version = "0.3.1", features = ["executor", "thread-pool"] }
|
||||||
|
@ -20,8 +20,9 @@
|
|||||||
|
|
||||||
//! Ed25519 keys.
|
//! Ed25519 keys.
|
||||||
|
|
||||||
use ed25519_dalek as ed25519;
|
use ed25519_dalek::{self as ed25519, Signer as _, Verifier as _};
|
||||||
use rand::RngCore;
|
use rand::RngCore;
|
||||||
|
use std::convert::TryFrom;
|
||||||
use super::error::DecodingError;
|
use super::error::DecodingError;
|
||||||
use zeroize::Zeroize;
|
use zeroize::Zeroize;
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
@ -107,7 +108,7 @@ pub struct PublicKey(ed25519::PublicKey);
|
|||||||
impl PublicKey {
|
impl PublicKey {
|
||||||
/// Verify the Ed25519 signature on a message using the public key.
|
/// Verify the Ed25519 signature on a message using the public key.
|
||||||
pub fn verify(&self, msg: &[u8], sig: &[u8]) -> bool {
|
pub fn verify(&self, msg: &[u8], sig: &[u8]) -> bool {
|
||||||
ed25519::Signature::from_bytes(sig).and_then(|s| self.0.verify(msg, &s)).is_ok()
|
ed25519::Signature::try_from(sig).and_then(|s| self.0.verify(msg, &s)).is_ok()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Encode the public key into a byte array in compressed form, i.e.
|
/// Encode the public key into a byte array in compressed form, i.e.
|
||||||
|
Reference in New Issue
Block a user