mirror of
https://github.com/mimblewimble/grin-wallet.git
synced 2025-01-20 19:11:09 +03:00
update ed25519_dalek release (#506)
This commit is contained in:
parent
b447dd1f69
commit
b58322fdda
10 changed files with 316 additions and 271 deletions
562
Cargo.lock
generated
562
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -22,7 +22,7 @@ easy-jsonrpc-mw = "0.5.4"
|
||||||
chrono = { version = "0.4.11", features = ["serde"] }
|
chrono = { version = "0.4.11", features = ["serde"] }
|
||||||
ring = "0.16"
|
ring = "0.16"
|
||||||
base64 = "0.12"
|
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_libwallet = { path = "../libwallet", version = "4.1.0-alpha.1" }
|
||||||
grin_wallet_config = { path = "../config", version = "4.1.0-alpha.1" }
|
grin_wallet_config = { path = "../config", version = "4.1.0-alpha.1" }
|
||||||
|
|
|
@ -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" }
|
grin_wallet_config = { path = "../config", version = "4.1.0-alpha.1" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
ed25519-dalek = "1.0.0-pre.3"
|
ed25519-dalek = "1.0.0-pre.4"
|
||||||
|
|
|
@ -34,7 +34,7 @@ hyper-timeout = "0.3"
|
||||||
byteorder = "1"
|
byteorder = "1"
|
||||||
hyper = "0.13"
|
hyper = "0.13"
|
||||||
hyper-socks2-mw = "0.4"
|
hyper-socks2-mw = "0.4"
|
||||||
ed25519-dalek = "1.0.0-pre.3"
|
ed25519-dalek = "1.0.0-pre.4"
|
||||||
x25519-dalek = "0.6"
|
x25519-dalek = "0.6"
|
||||||
data-encoding = "2"
|
data-encoding = "2"
|
||||||
regex = "1.3"
|
regex = "1.3"
|
||||||
|
|
|
@ -24,7 +24,7 @@ chrono = { version = "0.4.11", features = ["serde"] }
|
||||||
lazy_static = "1"
|
lazy_static = "1"
|
||||||
strum = "0.18"
|
strum = "0.18"
|
||||||
strum_macros = "0.18"
|
strum_macros = "0.18"
|
||||||
ed25519-dalek = "1.0.0-pre.3"
|
ed25519-dalek = "1.0.0-pre.4"
|
||||||
x25519-dalek = "0.6"
|
x25519-dalek = "0.6"
|
||||||
base64 = "0.9"
|
base64 = "0.9"
|
||||||
regex = "1.3"
|
regex = "1.3"
|
||||||
|
|
|
@ -35,6 +35,7 @@ use crate::{
|
||||||
use crate::{Error, ErrorKind};
|
use crate::{Error, ErrorKind};
|
||||||
use ed25519_dalek::PublicKey as DalekPublicKey;
|
use ed25519_dalek::PublicKey as DalekPublicKey;
|
||||||
use ed25519_dalek::SecretKey as DalekSecretKey;
|
use ed25519_dalek::SecretKey as DalekSecretKey;
|
||||||
|
use ed25519_dalek::Verifier;
|
||||||
|
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
use std::sync::mpsc::Sender;
|
use std::sync::mpsc::Sender;
|
||||||
|
|
|
@ -33,6 +33,7 @@ use ed25519_dalek::Keypair as DalekKeypair;
|
||||||
use ed25519_dalek::PublicKey as DalekPublicKey;
|
use ed25519_dalek::PublicKey as DalekPublicKey;
|
||||||
use ed25519_dalek::SecretKey as DalekSecretKey;
|
use ed25519_dalek::SecretKey as DalekSecretKey;
|
||||||
use ed25519_dalek::Signature as DalekSignature;
|
use ed25519_dalek::Signature as DalekSignature;
|
||||||
|
use ed25519_dalek::{Signer, Verifier};
|
||||||
|
|
||||||
// static for incrementing test UUIDs
|
// static for incrementing test UUIDs
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
|
|
|
@ -366,6 +366,7 @@ pub mod dalek_sig_serde {
|
||||||
use ed25519_dalek::Signature as DalekSignature;
|
use ed25519_dalek::Signature as DalekSignature;
|
||||||
use serde::de::Error;
|
use serde::de::Error;
|
||||||
use serde::{Deserialize, Deserializer, Serializer};
|
use serde::{Deserialize, Deserializer, Serializer};
|
||||||
|
use std::convert::TryFrom;
|
||||||
|
|
||||||
use crate::grin_util::{from_hex, ToHex};
|
use crate::grin_util::{from_hex, ToHex};
|
||||||
|
|
||||||
|
@ -387,7 +388,7 @@ pub mod dalek_sig_serde {
|
||||||
.and_then(|bytes: Vec<u8>| {
|
.and_then(|bytes: Vec<u8>| {
|
||||||
let mut b = [0u8; 64];
|
let mut b = [0u8; 64];
|
||||||
b.copy_from_slice(&bytes[0..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 ed25519_dalek::Signature as DalekSignature;
|
||||||
use serde::de::Error;
|
use serde::de::Error;
|
||||||
use serde::{Deserialize, Deserializer, Serializer};
|
use serde::{Deserialize, Deserializer, Serializer};
|
||||||
|
use std::convert::TryFrom;
|
||||||
|
|
||||||
use crate::grin_util::{from_hex, ToHex};
|
use crate::grin_util::{from_hex, ToHex};
|
||||||
|
|
||||||
|
@ -422,7 +424,7 @@ pub mod option_dalek_sig_serde {
|
||||||
.and_then(|bytes: Vec<u8>| {
|
.and_then(|bytes: Vec<u8>| {
|
||||||
let mut b = [0u8; 64];
|
let mut b = [0u8; 64];
|
||||||
b.copy_from_slice(&bytes[0..64]);
|
b.copy_from_slice(&bytes[0..64]);
|
||||||
DalekSignature::from_bytes(&b)
|
DalekSignature::try_from(b)
|
||||||
.map(Some)
|
.map(Some)
|
||||||
.map_err(|err| Error::custom(err.to_string()))
|
.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 ed25519_dalek::Signature as DalekSignature;
|
||||||
use serde::de::Error;
|
use serde::de::Error;
|
||||||
use serde::{Deserialize, Deserializer, Serializer};
|
use serde::{Deserialize, Deserializer, Serializer};
|
||||||
|
use std::convert::TryFrom;
|
||||||
|
|
||||||
///
|
///
|
||||||
pub fn serialize<S>(sig: &Option<DalekSignature>, serializer: S) -> Result<S::Ok, S::Error>
|
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>| {
|
.and_then(|bytes: Vec<u8>| {
|
||||||
let mut b = [0u8; 64];
|
let mut b = [0u8; 64];
|
||||||
b.copy_from_slice(&bytes[0..64]);
|
b.copy_from_slice(&bytes[0..64]);
|
||||||
DalekSignature::from_bytes(&b)
|
DalekSignature::try_from(b)
|
||||||
.map(Some)
|
.map(Some)
|
||||||
.map_err(|err| Error::custom(err.to_string()))
|
.map_err(|err| Error::custom(err.to_string()))
|
||||||
}),
|
}),
|
||||||
|
@ -598,6 +601,7 @@ mod test {
|
||||||
use ed25519_dalek::PublicKey as DalekPublicKey;
|
use ed25519_dalek::PublicKey as DalekPublicKey;
|
||||||
use ed25519_dalek::SecretKey as DalekSecretKey;
|
use ed25519_dalek::SecretKey as DalekSecretKey;
|
||||||
use ed25519_dalek::Signature as DalekSignature;
|
use ed25519_dalek::Signature as DalekSignature;
|
||||||
|
use ed25519_dalek::Signer;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
use serde_json;
|
use serde_json;
|
||||||
|
|
|
@ -23,6 +23,7 @@ use crate::grin_util::secp::pedersen::{Commitment, RangeProof};
|
||||||
use crate::grin_util::secp::Signature;
|
use crate::grin_util::secp::Signature;
|
||||||
use ed25519_dalek::PublicKey as DalekPublicKey;
|
use ed25519_dalek::PublicKey as DalekPublicKey;
|
||||||
use ed25519_dalek::Signature as DalekSignature;
|
use ed25519_dalek::Signature as DalekSignature;
|
||||||
|
use std::convert::TryFrom;
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
use crate::slate_versions::v4::{
|
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 raddr = DalekPublicKey::from_bytes(&reader.read_fixed_bytes(32)?).unwrap();
|
||||||
let rsig = match reader.read_u8()? {
|
let rsig = match reader.read_u8()? {
|
||||||
0 => None,
|
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 }))
|
Ok(ProofWrap(PaymentInfoV4 { saddr, raddr, rsig }))
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ edition = "2018"
|
||||||
rand = "0.6"
|
rand = "0.6"
|
||||||
serde = "1"
|
serde = "1"
|
||||||
serde_derive = "1"
|
serde_derive = "1"
|
||||||
ed25519-dalek = "1.0.0-pre.3"
|
ed25519-dalek = "1.0.0-pre.4"
|
||||||
data-encoding = "2"
|
data-encoding = "2"
|
||||||
sha3 = "0.8"
|
sha3 = "0.8"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue