ethcrypto renamed to ethcore-crypto and moved to ethcore dir (#8340)
* ethcrypto renamed to ethcore-crypto and moved to ethcore dir * fixed renaming
This commit is contained in:
parent
4f447c50b2
commit
bd7273061e
38
Cargo.lock
generated
38
Cargo.lock
generated
@ -566,6 +566,18 @@ dependencies = [
|
||||
name = "ethcore-bytes"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "ethcore-crypto"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)",
|
||||
"ethereum-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethkey 0.3.0",
|
||||
"rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"subtle 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ethcore-devtools"
|
||||
version = "1.11.0"
|
||||
@ -671,8 +683,8 @@ name = "ethcore-network"
|
||||
version = "1.11.0"
|
||||
dependencies = [
|
||||
"error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethcore-crypto 0.1.0",
|
||||
"ethcore-io 1.11.0",
|
||||
"ethcrypto 0.1.0",
|
||||
"ethereum-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethkey 0.3.0",
|
||||
"ipnetwork 0.12.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -688,10 +700,10 @@ dependencies = [
|
||||
"bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethcore-bytes 0.1.0",
|
||||
"ethcore-crypto 0.1.0",
|
||||
"ethcore-io 1.11.0",
|
||||
"ethcore-logger 1.11.0",
|
||||
"ethcore-network 1.11.0",
|
||||
"ethcrypto 0.1.0",
|
||||
"ethereum-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethkey 0.3.0",
|
||||
"igd 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -725,11 +737,11 @@ dependencies = [
|
||||
"ethabi-derive 5.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethcore 1.11.0",
|
||||
"ethcore-bytes 0.1.0",
|
||||
"ethcore-crypto 0.1.0",
|
||||
"ethcore-io 1.11.0",
|
||||
"ethcore-logger 1.11.0",
|
||||
"ethcore-miner 1.11.0",
|
||||
"ethcore-transaction 0.1.0",
|
||||
"ethcrypto 0.1.0",
|
||||
"ethereum-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethjson 0.1.0",
|
||||
"ethkey 0.3.0",
|
||||
@ -760,10 +772,10 @@ dependencies = [
|
||||
"ethabi-derive 5.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethcore 1.11.0",
|
||||
"ethcore-bytes 0.1.0",
|
||||
"ethcore-crypto 0.1.0",
|
||||
"ethcore-logger 1.11.0",
|
||||
"ethcore-sync 1.11.0",
|
||||
"ethcore-transaction 0.1.0",
|
||||
"ethcrypto 0.1.0",
|
||||
"ethereum-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethkey 0.3.0",
|
||||
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -868,18 +880,6 @@ dependencies = [
|
||||
"unexpected 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ethcrypto"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)",
|
||||
"ethereum-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethkey 0.3.0",
|
||||
"rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"subtle 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ethereum-types"
|
||||
version = "0.3.0"
|
||||
@ -950,7 +950,7 @@ name = "ethstore"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"dir 0.1.0",
|
||||
"ethcrypto 0.1.0",
|
||||
"ethcore-crypto 0.1.0",
|
||||
"ethereum-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethkey 0.3.0",
|
||||
"itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -2157,6 +2157,7 @@ dependencies = [
|
||||
"ethash 1.11.0",
|
||||
"ethcore 1.11.0",
|
||||
"ethcore-bytes 0.1.0",
|
||||
"ethcore-crypto 0.1.0",
|
||||
"ethcore-devtools 1.11.0",
|
||||
"ethcore-io 1.11.0",
|
||||
"ethcore-light 1.11.0",
|
||||
@ -2166,7 +2167,6 @@ dependencies = [
|
||||
"ethcore-private-tx 1.0.0",
|
||||
"ethcore-sync 1.11.0",
|
||||
"ethcore-transaction 0.1.0",
|
||||
"ethcrypto 0.1.0",
|
||||
"ethereum-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethjson 0.1.0",
|
||||
"ethkey 0.3.0",
|
||||
@ -2341,8 +2341,8 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethcore-crypto 0.1.0",
|
||||
"ethcore-network 1.11.0",
|
||||
"ethcrypto 0.1.0",
|
||||
"ethereum-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethkey 0.3.0",
|
||||
"hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "ethcrypto"
|
||||
name = "ethcore-crypto"
|
||||
version = "0.1.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
|
||||
@ -7,7 +7,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
||||
rust-crypto = "0.2.36"
|
||||
tiny-keccak = "1.3"
|
||||
eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1", optional = true }
|
||||
ethkey = { path = "../ethkey", optional = true }
|
||||
ethkey = { path = "../../ethkey", optional = true }
|
||||
ethereum-types = "0.3"
|
||||
subtle = "0.5"
|
||||
|
@ -12,11 +12,11 @@ ethabi-contract = "5.0"
|
||||
ethabi-derive = "5.0"
|
||||
ethcore = { path = ".." }
|
||||
ethcore-bytes = { path = "../../util/bytes" }
|
||||
ethcore-crypto = { path = "../crypto" }
|
||||
ethcore-io = { path = "../../util/io" }
|
||||
ethcore-logger = { path = "../../logger" }
|
||||
ethcore-miner = { path = "../../miner" }
|
||||
ethcore-transaction = { path = "../transaction" }
|
||||
ethcrypto = { path = "../../ethcrypto" }
|
||||
ethereum-types = "0.3"
|
||||
ethjson = { path = "../../json" }
|
||||
ethkey = { path = "../../ethkey" }
|
||||
|
@ -27,7 +27,7 @@ use ethcore::account_provider::AccountProvider;
|
||||
use ethereum_types::{H128, H256, Address};
|
||||
use ethjson;
|
||||
use ethkey::{Signature, Public};
|
||||
use ethcrypto;
|
||||
use crypto;
|
||||
use futures::Future;
|
||||
use fetch::{Fetch, Client as FetchClient, Method, BodyReader, Request};
|
||||
use bytes::{Bytes, ToPretty};
|
||||
@ -151,7 +151,7 @@ impl SecretStoreEncryptor {
|
||||
let password = find_account_password(&self.config.passwords, &*accounts, &requester);
|
||||
|
||||
// decrypt Public
|
||||
let decrypted_bytes = accounts.decrypt(requester, password, ðcrypto::DEFAULT_MAC, &encrypted_bytes)?;
|
||||
let decrypted_bytes = accounts.decrypt(requester, password, &crypto::DEFAULT_MAC, &encrypted_bytes)?;
|
||||
let decrypted_key = Public::from_slice(&decrypted_bytes);
|
||||
|
||||
// and now take x coordinate of Public as a key
|
||||
@ -217,7 +217,7 @@ impl Encryptor for SecretStoreEncryptor {
|
||||
// encrypt data
|
||||
let mut cypher = Vec::with_capacity(plain_data.len() + initialisation_vector.len());
|
||||
cypher.extend(repeat(0).take(plain_data.len()));
|
||||
ethcrypto::aes::encrypt(&key, initialisation_vector, plain_data, &mut cypher);
|
||||
crypto::aes::encrypt(&key, initialisation_vector, plain_data, &mut cypher);
|
||||
cypher.extend_from_slice(&initialisation_vector);
|
||||
|
||||
Ok(cypher)
|
||||
@ -243,7 +243,7 @@ impl Encryptor for SecretStoreEncryptor {
|
||||
let (cypher, iv) = cypher.split_at(cypher_len - INIT_VEC_LEN);
|
||||
let mut plain_data = Vec::with_capacity(cypher_len - INIT_VEC_LEN);
|
||||
plain_data.extend(repeat(0).take(cypher_len - INIT_VEC_LEN));
|
||||
ethcrypto::aes::decrypt(&key, &iv, cypher, &mut plain_data);
|
||||
crypto::aes::decrypt(&key, &iv, cypher, &mut plain_data);
|
||||
|
||||
Ok(plain_data)
|
||||
}
|
||||
|
@ -26,11 +26,11 @@ mod messages;
|
||||
mod error;
|
||||
|
||||
extern crate ethcore;
|
||||
extern crate ethcore_io as io;
|
||||
extern crate ethcore_bytes as bytes;
|
||||
extern crate ethcore_transaction as transaction;
|
||||
extern crate ethcore_crypto as crypto;
|
||||
extern crate ethcore_io as io;
|
||||
extern crate ethcore_miner;
|
||||
extern crate ethcrypto;
|
||||
extern crate ethcore_transaction as transaction;
|
||||
extern crate ethabi;
|
||||
extern crate ethereum_types;
|
||||
extern crate ethkey;
|
||||
|
@ -17,7 +17,7 @@ tiny-keccak = "1.3"
|
||||
time = "0.1.34"
|
||||
itertools = "0.5"
|
||||
parking_lot = "0.5"
|
||||
ethcrypto = { path = "../ethcrypto" }
|
||||
ethcore-crypto = { path = "../ethcore/crypto" }
|
||||
ethereum-types = "0.3"
|
||||
dir = { path = "../util/dir" }
|
||||
smallvec = "0.4"
|
||||
|
@ -33,7 +33,7 @@ extern crate time;
|
||||
extern crate tiny_keccak;
|
||||
extern crate tempdir;
|
||||
|
||||
extern crate ethcrypto as crypto;
|
||||
extern crate ethcore_crypto as crypto;
|
||||
extern crate ethereum_types;
|
||||
extern crate ethkey as _ethkey;
|
||||
extern crate parity_wordlist;
|
||||
|
@ -39,6 +39,7 @@ jsonrpc-pubsub = { git = "https://github.com/paritytech/jsonrpc.git", branch = "
|
||||
ethash = { path = "../ethash" }
|
||||
ethcore = { path = "../ethcore" }
|
||||
ethcore-bytes = { path = "../util/bytes" }
|
||||
ethcore-crypto = { path = "../ethcore/crypto" }
|
||||
ethcore-devtools = { path = "../devtools" }
|
||||
ethcore-io = { path = "../util/io" }
|
||||
ethcore-light = { path = "../ethcore/light" }
|
||||
@ -49,7 +50,6 @@ ethcore-sync = { path = "../ethcore/sync" }
|
||||
ethcore-transaction = { path = "../ethcore/transaction" }
|
||||
ethereum-types = "0.3"
|
||||
|
||||
ethcrypto = { path = "../ethcrypto" }
|
||||
ethjson = { path = "../json" }
|
||||
ethkey = { path = "../ethkey" }
|
||||
ethstore = { path = "../ethstore" }
|
||||
|
@ -46,6 +46,7 @@ extern crate jsonrpc_pubsub;
|
||||
extern crate ethash;
|
||||
extern crate ethcore;
|
||||
extern crate ethcore_bytes as bytes;
|
||||
extern crate ethcore_crypto as crypto;
|
||||
extern crate ethcore_devtools as devtools;
|
||||
extern crate ethcore_io as io;
|
||||
extern crate ethcore_light as light;
|
||||
@ -54,7 +55,6 @@ extern crate ethcore_miner as miner;
|
||||
extern crate ethcore_private_tx;
|
||||
extern crate ethcore_sync as sync;
|
||||
extern crate ethcore_transaction as transaction;
|
||||
extern crate ethcrypto as crypto;
|
||||
extern crate ethereum_types;
|
||||
extern crate ethkey;
|
||||
extern crate ethstore;
|
||||
|
@ -24,14 +24,14 @@ tokio-proto = "0.1"
|
||||
url = "1.0"
|
||||
ethcore = { path = "../ethcore" }
|
||||
ethcore-bytes = { path = "../util/bytes" }
|
||||
ethcore-crypto = { path = "../ethcore/crypto" }
|
||||
ethcore-logger = { path = "../logger" }
|
||||
ethcore-sync = { path = "../ethcore/sync" }
|
||||
ethcore-transaction = { path = "../ethcore/transaction" }
|
||||
ethereum-types = "0.3"
|
||||
kvdb = { path = "../util/kvdb" }
|
||||
kvdb-rocksdb = { path = "../util/kvdb-rocksdb" }
|
||||
keccak-hash = { path = "../util/hash" }
|
||||
ethcore-logger = { path = "../logger" }
|
||||
ethcrypto = { path = "../ethcrypto" }
|
||||
ethkey = { path = "../ethkey" }
|
||||
lazy_static = "1.0"
|
||||
ethabi = "5.1"
|
||||
|
@ -21,7 +21,7 @@ use std::sync::mpsc;
|
||||
use futures::{self, Future};
|
||||
use parking_lot::Mutex;
|
||||
use tokio_core::reactor::Core;
|
||||
use ethcrypto;
|
||||
use crypto;
|
||||
use super::acl_storage::AclStorage;
|
||||
use super::key_storage::KeyStorage;
|
||||
use super::key_server_set::KeyServerSet;
|
||||
@ -105,7 +105,7 @@ impl DocumentKeyServer for KeyServerImpl {
|
||||
self.store_document_key(key_id, author, encrypted_document_key.common_point, encrypted_document_key.encrypted_point)?;
|
||||
|
||||
// encrypt document key with requestor public key
|
||||
let document_key = ethcrypto::ecies::encrypt(&public, ðcrypto::DEFAULT_MAC, &document_key)
|
||||
let document_key = crypto::ecies::encrypt(&public, &crypto::DEFAULT_MAC, &document_key)
|
||||
.map_err(|err| Error::Internal(format!("Error encrypting document key: {}", err)))?;
|
||||
Ok(document_key)
|
||||
}
|
||||
@ -122,7 +122,7 @@ impl DocumentKeyServer for KeyServerImpl {
|
||||
.decrypted_secret;
|
||||
|
||||
// encrypt document key with requestor public key
|
||||
let document_key = ethcrypto::ecies::encrypt(&public, ðcrypto::DEFAULT_MAC, &document_key)
|
||||
let document_key = crypto::ecies::encrypt(&public, &crypto::DEFAULT_MAC, &document_key)
|
||||
.map_err(|err| Error::Internal(format!("Error encrypting document key: {}", err)))?;
|
||||
Ok(document_key)
|
||||
}
|
||||
@ -152,7 +152,7 @@ impl MessageSigner for KeyServerImpl {
|
||||
combined_signature[32..].clone_from_slice(&**message_signature.1);
|
||||
|
||||
// encrypt combined signature with requestor public key
|
||||
let message_signature = ethcrypto::ecies::encrypt(&public, ðcrypto::DEFAULT_MAC, &combined_signature)
|
||||
let message_signature = crypto::ecies::encrypt(&public, &crypto::DEFAULT_MAC, &combined_signature)
|
||||
.map_err(|err| Error::Internal(format!("Error encrypting message signature: {}", err)))?;
|
||||
Ok(message_signature)
|
||||
}
|
||||
@ -167,7 +167,7 @@ impl MessageSigner for KeyServerImpl {
|
||||
let message_signature = signing_session.wait()?;
|
||||
|
||||
// encrypt combined signature with requestor public key
|
||||
let message_signature = ethcrypto::ecies::encrypt(&public, ðcrypto::DEFAULT_MAC, &*message_signature)
|
||||
let message_signature = crypto::ecies::encrypt(&public, &crypto::DEFAULT_MAC, &*message_signature)
|
||||
.map_err(|err| Error::Internal(format!("Error encrypting message signature: {}", err)))?;
|
||||
Ok(message_signature)
|
||||
}
|
||||
@ -229,7 +229,7 @@ pub mod tests {
|
||||
use std::sync::Arc;
|
||||
use std::net::SocketAddr;
|
||||
use std::collections::BTreeMap;
|
||||
use ethcrypto;
|
||||
use crypto;
|
||||
use ethkey::{self, Secret, Random, Generator, verify_public};
|
||||
use acl_storage::DummyAclStorage;
|
||||
use key_storage::KeyStorage;
|
||||
@ -358,12 +358,12 @@ pub mod tests {
|
||||
let secret = Random.generate().unwrap().secret().clone();
|
||||
let signature = ethkey::sign(&secret, &document).unwrap();
|
||||
let generated_key = key_servers[0].generate_document_key(&document, &signature.clone().into(), threshold).unwrap();
|
||||
let generated_key = ethcrypto::ecies::decrypt(&secret, ðcrypto::DEFAULT_MAC, &generated_key).unwrap();
|
||||
let generated_key = crypto::ecies::decrypt(&secret, &crypto::DEFAULT_MAC, &generated_key).unwrap();
|
||||
|
||||
// now let's try to retrieve key back
|
||||
for key_server in key_servers.iter() {
|
||||
let retrieved_key = key_server.restore_document_key(&document, &signature.clone().into()).unwrap();
|
||||
let retrieved_key = ethcrypto::ecies::decrypt(&secret, ðcrypto::DEFAULT_MAC, &retrieved_key).unwrap();
|
||||
let retrieved_key = crypto::ecies::decrypt(&secret, &crypto::DEFAULT_MAC, &retrieved_key).unwrap();
|
||||
assert_eq!(retrieved_key, generated_key);
|
||||
}
|
||||
}
|
||||
@ -380,12 +380,12 @@ pub mod tests {
|
||||
let secret = Random.generate().unwrap().secret().clone();
|
||||
let signature = ethkey::sign(&secret, &document).unwrap();
|
||||
let generated_key = key_servers[0].generate_document_key(&document, &signature.clone().into(), *threshold).unwrap();
|
||||
let generated_key = ethcrypto::ecies::decrypt(&secret, ðcrypto::DEFAULT_MAC, &generated_key).unwrap();
|
||||
let generated_key = crypto::ecies::decrypt(&secret, &crypto::DEFAULT_MAC, &generated_key).unwrap();
|
||||
|
||||
// now let's try to retrieve key back
|
||||
for (i, key_server) in key_servers.iter().enumerate() {
|
||||
let retrieved_key = key_server.restore_document_key(&document, &signature.clone().into()).unwrap();
|
||||
let retrieved_key = ethcrypto::ecies::decrypt(&secret, ðcrypto::DEFAULT_MAC, &retrieved_key).unwrap();
|
||||
let retrieved_key = crypto::ecies::decrypt(&secret, &crypto::DEFAULT_MAC, &retrieved_key).unwrap();
|
||||
assert_eq!(retrieved_key, generated_key);
|
||||
|
||||
let key_share = key_storages[i].get(&document).unwrap().unwrap();
|
||||
@ -419,7 +419,7 @@ pub mod tests {
|
||||
// now let's try to retrieve key back
|
||||
for key_server in key_servers.iter() {
|
||||
let retrieved_key = key_server.restore_document_key(&server_key_id, &signature.clone().into()).unwrap();
|
||||
let retrieved_key = ethcrypto::ecies::decrypt(&requestor_secret, ðcrypto::DEFAULT_MAC, &retrieved_key).unwrap();
|
||||
let retrieved_key = crypto::ecies::decrypt(&requestor_secret, &crypto::DEFAULT_MAC, &retrieved_key).unwrap();
|
||||
let retrieved_key = Public::from_slice(&retrieved_key);
|
||||
assert_eq!(retrieved_key, generated_key);
|
||||
}
|
||||
@ -442,7 +442,7 @@ pub mod tests {
|
||||
// sign message
|
||||
let message_hash = H256::from(42);
|
||||
let combined_signature = key_servers[0].sign_message_schnorr(&server_key_id, &signature.into(), message_hash.clone()).unwrap();
|
||||
let combined_signature = ethcrypto::ecies::decrypt(&requestor_secret, ðcrypto::DEFAULT_MAC, &combined_signature).unwrap();
|
||||
let combined_signature = crypto::ecies::decrypt(&requestor_secret, &crypto::DEFAULT_MAC, &combined_signature).unwrap();
|
||||
let signature_c = Secret::from_slice(&combined_signature[..32]);
|
||||
let signature_s = Secret::from_slice(&combined_signature[32..]);
|
||||
|
||||
@ -462,14 +462,14 @@ pub mod tests {
|
||||
let secret = Random.generate().unwrap().secret().clone();
|
||||
let signature = ethkey::sign(&secret, &document).unwrap();
|
||||
let generated_key = key_servers[0].generate_document_key(&document, &signature.clone().into(), threshold).unwrap();
|
||||
let generated_key = ethcrypto::ecies::decrypt(&secret, ðcrypto::DEFAULT_MAC, &generated_key).unwrap();
|
||||
let generated_key = crypto::ecies::decrypt(&secret, &crypto::DEFAULT_MAC, &generated_key).unwrap();
|
||||
|
||||
// remove key from node0
|
||||
key_servers[0].cluster().key_storage().remove(&document).unwrap();
|
||||
|
||||
// now let's try to retrieve key back by requesting it from node0, so that session must be delegated
|
||||
let retrieved_key = key_servers[0].restore_document_key(&document, &signature.into()).unwrap();
|
||||
let retrieved_key = ethcrypto::ecies::decrypt(&secret, ðcrypto::DEFAULT_MAC, &retrieved_key).unwrap();
|
||||
let retrieved_key = crypto::ecies::decrypt(&secret, &crypto::DEFAULT_MAC, &retrieved_key).unwrap();
|
||||
assert_eq!(retrieved_key, generated_key);
|
||||
}
|
||||
|
||||
@ -491,7 +491,7 @@ pub mod tests {
|
||||
// sign message
|
||||
let message_hash = H256::from(42);
|
||||
let combined_signature = key_servers[0].sign_message_schnorr(&server_key_id, &signature.into(), message_hash.clone()).unwrap();
|
||||
let combined_signature = ethcrypto::ecies::decrypt(&requestor_secret, ðcrypto::DEFAULT_MAC, &combined_signature).unwrap();
|
||||
let combined_signature = crypto::ecies::decrypt(&requestor_secret, &crypto::DEFAULT_MAC, &combined_signature).unwrap();
|
||||
let signature_c = Secret::from_slice(&combined_signature[..32]);
|
||||
let signature_s = Secret::from_slice(&combined_signature[32..]);
|
||||
|
||||
@ -517,7 +517,7 @@ pub mod tests {
|
||||
// sign message
|
||||
let message_hash = H256::random();
|
||||
let signature = key_servers[0].sign_message_ecdsa(&server_key_id, &signature.into(), message_hash.clone()).unwrap();
|
||||
let signature = ethcrypto::ecies::decrypt(&requestor_secret, ðcrypto::DEFAULT_MAC, &signature).unwrap();
|
||||
let signature = crypto::ecies::decrypt(&requestor_secret, &crypto::DEFAULT_MAC, &signature).unwrap();
|
||||
let signature: H520 = signature[0..65].into();
|
||||
|
||||
// check signature
|
||||
|
@ -1269,8 +1269,8 @@ mod tests {
|
||||
assert!(decrypted_secret.common_point.is_some());
|
||||
assert!(decrypted_secret.decrypt_shadows.is_some());
|
||||
// check that KS client is able to restore original secret
|
||||
use ethcrypto::DEFAULT_MAC;
|
||||
use ethcrypto::ecies::decrypt;
|
||||
use crypto::DEFAULT_MAC;
|
||||
use crypto::ecies::decrypt;
|
||||
let decrypt_shadows: Vec<_> = decrypted_secret.decrypt_shadows.unwrap().into_iter()
|
||||
.map(|c| Secret::from_slice(&decrypt(key_pair.secret(), &DEFAULT_MAC, &c).unwrap()))
|
||||
.collect();
|
||||
@ -1413,8 +1413,8 @@ mod tests {
|
||||
assert_eq!(1, sessions.iter().skip(1).filter(|s| s.broadcast_shadows().is_none()).count());
|
||||
|
||||
// 4 nodes must be able to recover original secret
|
||||
use ethcrypto::DEFAULT_MAC;
|
||||
use ethcrypto::ecies::decrypt;
|
||||
use crypto::DEFAULT_MAC;
|
||||
use crypto::ecies::decrypt;
|
||||
let result = sessions[0].decrypted_secret().unwrap().unwrap();
|
||||
assert_eq!(3, sessions.iter().skip(1).filter(|s| s.decrypted_secret() == Some(Ok(result.clone()))).count());
|
||||
let decrypt_shadows: Vec<_> = result.decrypt_shadows.unwrap().into_iter()
|
||||
|
@ -37,7 +37,7 @@ use std::sync::Arc;
|
||||
use std::collections::BTreeSet;
|
||||
use futures::{Future, Poll, Async};
|
||||
use tokio_io::{AsyncRead, AsyncWrite};
|
||||
use ethcrypto::ecdh::agree;
|
||||
use crypto::ecdh::agree;
|
||||
use ethkey::{Random, Generator, KeyPair, Public, Signature, verify_public, sign, recover};
|
||||
use ethereum_types::H256;
|
||||
use key_server_cluster::{NodeId, Error, NodeKeyPair};
|
||||
|
@ -19,7 +19,7 @@ use std::u16;
|
||||
use std::ops::Deref;
|
||||
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
|
||||
use serde_json;
|
||||
use ethcrypto::ecies;
|
||||
use crypto::ecies;
|
||||
use ethkey::{Secret, KeyPair};
|
||||
use ethkey::math::curve_order;
|
||||
use ethereum_types::{H256, U256};
|
||||
@ -306,7 +306,7 @@ pub mod tests {
|
||||
use futures::Poll;
|
||||
use tokio_io::{AsyncRead, AsyncWrite};
|
||||
use ethkey::{Random, Generator, KeyPair};
|
||||
use ethcrypto::ecdh::agree;
|
||||
use crypto::ecdh::agree;
|
||||
use key_server_cluster::Error;
|
||||
use key_server_cluster::message::Message;
|
||||
use super::{MESSAGE_HEADER_SIZE, CURRENT_HEADER_VERSION, MessageHeader, fix_shared_key, encrypt_message,
|
||||
|
@ -17,8 +17,8 @@
|
||||
use std::collections::{BTreeSet, BTreeMap};
|
||||
use ethereum_types::H256;
|
||||
use ethkey::{Public, Secret};
|
||||
use ethcrypto::ecies::encrypt;
|
||||
use ethcrypto::DEFAULT_MAC;
|
||||
use crypto::ecies::encrypt;
|
||||
use crypto::DEFAULT_MAC;
|
||||
use key_server_cluster::{Error, NodeId, DocumentKeyShare, EncryptedDocumentKeyShadow};
|
||||
use key_server_cluster::math;
|
||||
use key_server_cluster::jobs::job_session::{JobPartialRequestAction, JobPartialResponseAction, JobExecutor};
|
||||
|
@ -17,7 +17,7 @@
|
||||
use std::fmt;
|
||||
use std::io::Error as IoError;
|
||||
use ethkey;
|
||||
use ethcrypto;
|
||||
use crypto;
|
||||
use super::types::all::ServerKeyId;
|
||||
|
||||
pub use super::traits::NodeKeyPair;
|
||||
@ -124,8 +124,8 @@ impl From<ethkey::Error> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ethcrypto::Error> for Error {
|
||||
fn from(err: ethcrypto::Error) -> Self {
|
||||
impl From<crypto::Error> for Error {
|
||||
fn from(err: crypto::Error) -> Self {
|
||||
Error::EthKey(err.into())
|
||||
}
|
||||
}
|
||||
|
@ -18,10 +18,10 @@ extern crate byteorder;
|
||||
extern crate ethabi;
|
||||
extern crate ethcore;
|
||||
extern crate ethcore_bytes as bytes;
|
||||
extern crate ethcore_crypto as crypto;
|
||||
extern crate ethcore_logger as logger;
|
||||
extern crate ethcore_sync as sync;
|
||||
extern crate ethcore_transaction as transaction;
|
||||
extern crate ethcrypto;
|
||||
extern crate ethereum_types;
|
||||
extern crate ethkey;
|
||||
extern crate futures_cpupool;
|
||||
|
@ -15,7 +15,7 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::sync::Arc;
|
||||
use ethcrypto::ecdh::agree;
|
||||
use crypto::ecdh::agree;
|
||||
use ethkey::{KeyPair, Public, Signature, Error as EthKeyError, sign, public_to_address};
|
||||
use ethcore::account_provider::AccountProvider;
|
||||
use ethereum_types::{H256, Address};
|
||||
|
@ -21,13 +21,13 @@ ansi_term = "0.10"
|
||||
rustc-hex = "1.0"
|
||||
ethcore-io = { path = "../io" }
|
||||
ethcore-bytes = { path = "../bytes" }
|
||||
ethcore-crypto = { path = "../../ethcore/crypto" }
|
||||
ethcore-logger = { path ="../../logger" }
|
||||
ethcore-network = { path = "../network" }
|
||||
ethereum-types = "0.3"
|
||||
ethkey = { path = "../../ethkey" }
|
||||
ethcrypto = { path = "../../ethcrypto" }
|
||||
rlp = { path = "../rlp" }
|
||||
path = { path = "../path" }
|
||||
ethcore-logger = { path ="../../logger" }
|
||||
ipnetwork = "0.12.6"
|
||||
keccak-hash = { path = "../hash" }
|
||||
snappy = { git = "https://github.com/paritytech/rust-snappy" }
|
||||
|
@ -61,6 +61,7 @@
|
||||
|
||||
extern crate ethcore_io as io;
|
||||
extern crate ethcore_bytes;
|
||||
extern crate ethcore_crypto as crypto;
|
||||
extern crate ethereum_types;
|
||||
extern crate parking_lot;
|
||||
extern crate mio;
|
||||
@ -73,7 +74,6 @@ extern crate igd;
|
||||
extern crate libc;
|
||||
extern crate slab;
|
||||
extern crate ethkey;
|
||||
extern crate ethcrypto as crypto;
|
||||
extern crate rlp;
|
||||
extern crate bytes;
|
||||
extern crate path;
|
||||
|
@ -7,11 +7,11 @@ version = "1.11.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
|
||||
[dependencies]
|
||||
error-chain = { version = "0.11", default-features = false }
|
||||
ethcore-crypto = { path = "../../ethcore/crypto" }
|
||||
ethcore-io = { path = "../io" }
|
||||
ethereum-types = "0.3"
|
||||
ethkey = { path = "../../ethkey" }
|
||||
ethcrypto = { path = "../../ethcrypto" }
|
||||
rlp = { path = "../rlp" }
|
||||
ipnetwork = "0.12.6"
|
||||
rlp = { path = "../rlp" }
|
||||
snappy = { git = "https://github.com/paritytech/rust-snappy" }
|
||||
error-chain = { version = "0.11", default-features = false }
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
#![recursion_limit="128"]
|
||||
|
||||
extern crate ethcore_crypto as crypto;
|
||||
extern crate ethcore_io as io;
|
||||
extern crate ethcrypto as crypto;
|
||||
extern crate ethereum_types;
|
||||
extern crate ethkey;
|
||||
extern crate rlp;
|
||||
|
@ -9,7 +9,7 @@ bitflags = "0.9"
|
||||
byteorder = "1.0.0"
|
||||
ethereum-types = "0.3"
|
||||
ethcore-network = { path = "../util/network" }
|
||||
ethcrypto = { path = "../ethcrypto" }
|
||||
ethcore-crypto = { path = "../ethcore/crypto" }
|
||||
ethkey = { path = "../ethkey" }
|
||||
hex = "0.2"
|
||||
log = "0.3"
|
||||
|
@ -18,8 +18,8 @@
|
||||
//! interface.
|
||||
|
||||
extern crate byteorder;
|
||||
extern crate ethcore_crypto as crypto;
|
||||
extern crate ethcore_network as network;
|
||||
extern crate ethcrypto;
|
||||
extern crate ethereum_types;
|
||||
extern crate ethkey;
|
||||
extern crate hex;
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
//! Encryption schemes supported by RPC layer.
|
||||
|
||||
use crypto;
|
||||
use ethereum_types::H256;
|
||||
use ethkey::{self, Public, Secret};
|
||||
use ring::aead::{self, AES_256_GCM, SealingKey, OpeningKey};
|
||||
@ -117,7 +118,7 @@ impl EncryptionInstance {
|
||||
}
|
||||
}
|
||||
EncryptionInner::ECIES(valid_public) => {
|
||||
::ethcrypto::ecies::encrypt(&valid_public, &[], plain)
|
||||
crypto::ecies::encrypt(&valid_public, &[], plain)
|
||||
.expect("validity of public key an invariant of the type; qed")
|
||||
}
|
||||
}
|
||||
@ -213,7 +214,7 @@ impl DecryptionInstance {
|
||||
}
|
||||
DecryptionInner::ECIES(secret) => {
|
||||
// secret is checked for validity, so only fails on invalid message.
|
||||
::ethcrypto::ecies::decrypt(&secret, &[], ciphertext).ok()
|
||||
crypto::ecies::decrypt(&secret, &[], ciphertext).ok()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user