update ed25519_dalek release (#506)

This commit is contained in:
Yeastplume 2020-08-10 14:42:53 +01:00 committed by GitHub
parent b447dd1f69
commit b58322fdda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 316 additions and 271 deletions

562
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -22,7 +22,7 @@ easy-jsonrpc-mw = "0.5.4"
chrono = { version = "0.4.11", features = ["serde"] }
ring = "0.16"
base64 = "0.12"
ed25519-dalek = "1.0.0-pre.3"
ed25519-dalek = "1.0.0-pre.4"
grin_wallet_libwallet = { path = "../libwallet", version = "4.1.0-alpha.1" }
grin_wallet_config = { path = "../config", version = "4.1.0-alpha.1" }

View file

@ -38,4 +38,4 @@ grin_wallet_libwallet = { path = "../libwallet", version = "4.1.0-alpha.1" }
grin_wallet_config = { path = "../config", version = "4.1.0-alpha.1" }
[dev-dependencies]
ed25519-dalek = "1.0.0-pre.3"
ed25519-dalek = "1.0.0-pre.4"

View file

@ -34,7 +34,7 @@ hyper-timeout = "0.3"
byteorder = "1"
hyper = "0.13"
hyper-socks2-mw = "0.4"
ed25519-dalek = "1.0.0-pre.3"
ed25519-dalek = "1.0.0-pre.4"
x25519-dalek = "0.6"
data-encoding = "2"
regex = "1.3"

View file

@ -24,7 +24,7 @@ chrono = { version = "0.4.11", features = ["serde"] }
lazy_static = "1"
strum = "0.18"
strum_macros = "0.18"
ed25519-dalek = "1.0.0-pre.3"
ed25519-dalek = "1.0.0-pre.4"
x25519-dalek = "0.6"
base64 = "0.9"
regex = "1.3"

View file

@ -35,6 +35,7 @@ use crate::{
use crate::{Error, ErrorKind};
use ed25519_dalek::PublicKey as DalekPublicKey;
use ed25519_dalek::SecretKey as DalekSecretKey;
use ed25519_dalek::Verifier;
use std::convert::TryFrom;
use std::sync::mpsc::Sender;

View file

@ -33,6 +33,7 @@ use ed25519_dalek::Keypair as DalekKeypair;
use ed25519_dalek::PublicKey as DalekPublicKey;
use ed25519_dalek::SecretKey as DalekSecretKey;
use ed25519_dalek::Signature as DalekSignature;
use ed25519_dalek::{Signer, Verifier};
// static for incrementing test UUIDs
lazy_static! {

View file

@ -366,6 +366,7 @@ pub mod dalek_sig_serde {
use ed25519_dalek::Signature as DalekSignature;
use serde::de::Error;
use serde::{Deserialize, Deserializer, Serializer};
use std::convert::TryFrom;
use crate::grin_util::{from_hex, ToHex};
@ -387,7 +388,7 @@ pub mod dalek_sig_serde {
.and_then(|bytes: Vec<u8>| {
let mut b = [0u8; 64];
b.copy_from_slice(&bytes[0..64]);
DalekSignature::from_bytes(&b).map_err(|err| Error::custom(err.to_string()))
DalekSignature::try_from(b).map_err(|err| Error::custom(err.to_string()))
})
}
}
@ -397,6 +398,7 @@ pub mod option_dalek_sig_serde {
use ed25519_dalek::Signature as DalekSignature;
use serde::de::Error;
use serde::{Deserialize, Deserializer, Serializer};
use std::convert::TryFrom;
use crate::grin_util::{from_hex, ToHex};
@ -422,7 +424,7 @@ pub mod option_dalek_sig_serde {
.and_then(|bytes: Vec<u8>| {
let mut b = [0u8; 64];
b.copy_from_slice(&bytes[0..64]);
DalekSignature::from_bytes(&b)
DalekSignature::try_from(b)
.map(Some)
.map_err(|err| Error::custom(err.to_string()))
}),
@ -437,6 +439,7 @@ pub mod option_dalek_sig_base64 {
use ed25519_dalek::Signature as DalekSignature;
use serde::de::Error;
use serde::{Deserialize, Deserializer, Serializer};
use std::convert::TryFrom;
///
pub fn serialize<S>(sig: &Option<DalekSignature>, serializer: S) -> Result<S::Ok, S::Error>
@ -460,7 +463,7 @@ pub mod option_dalek_sig_base64 {
.and_then(|bytes: Vec<u8>| {
let mut b = [0u8; 64];
b.copy_from_slice(&bytes[0..64]);
DalekSignature::from_bytes(&b)
DalekSignature::try_from(b)
.map(Some)
.map_err(|err| Error::custom(err.to_string()))
}),
@ -598,6 +601,7 @@ mod test {
use ed25519_dalek::PublicKey as DalekPublicKey;
use ed25519_dalek::SecretKey as DalekSecretKey;
use ed25519_dalek::Signature as DalekSignature;
use ed25519_dalek::Signer;
use serde::Deserialize;
use serde_json;

View file

@ -23,6 +23,7 @@ use crate::grin_util::secp::pedersen::{Commitment, RangeProof};
use crate::grin_util::secp::Signature;
use ed25519_dalek::PublicKey as DalekPublicKey;
use ed25519_dalek::Signature as DalekSignature;
use std::convert::TryFrom;
use uuid::Uuid;
use crate::slate_versions::v4::{
@ -347,7 +348,7 @@ impl Readable for ProofWrap {
let raddr = DalekPublicKey::from_bytes(&reader.read_fixed_bytes(32)?).unwrap();
let rsig = match reader.read_u8()? {
0 => None,
1 | _ => Some(DalekSignature::from_bytes(&reader.read_fixed_bytes(64)?).unwrap()),
1 | _ => Some(DalekSignature::try_from(&reader.read_fixed_bytes(64)?[..]).unwrap()),
};
Ok(ProofWrap(PaymentInfoV4 { saddr, raddr, rsig }))
}

View file

@ -13,7 +13,7 @@ edition = "2018"
rand = "0.6"
serde = "1"
serde_derive = "1"
ed25519-dalek = "1.0.0-pre.3"
ed25519-dalek = "1.0.0-pre.4"
data-encoding = "2"
sha3 = "0.8"