Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c24414f
Crypto utils removed from ethkey
grbIzl Sep 24, 2019
765a2d9
Fix ethkey lib
grbIzl Oct 8, 2019
2817f9a
Switch ethsore to new crypto
grbIzl Oct 10, 2019
d4c06f8
Accounts crate fixed
grbIzl Oct 10, 2019
824cf92
Secret store crate switched to new crypto
grbIzl Oct 10, 2019
7d38b66
Ethcore builtin fixed
grbIzl Oct 11, 2019
3f10de5
Accounts crate fixed
grbIzl Oct 16, 2019
265968a
Ethcore crate fixed
grbIzl Oct 16, 2019
efad258
Util network fixed
grbIzl Oct 16, 2019
903317a
Util network-devp2p fixed
grbIzl Oct 16, 2019
3d00913
Private tx fixed
grbIzl Oct 16, 2019
3909613
Ethcore sync fixed
grbIzl Oct 16, 2019
77781fb
Secret store fixed
grbIzl Oct 16, 2019
1463b5c
Rpc fixed
grbIzl Oct 16, 2019
7486d65
Parity fixed
grbIzl Oct 16, 2019
0d6ab9f
Ethkey cli fixed
grbIzl Oct 16, 2019
84b292a
Local store fixed
grbIzl Oct 17, 2019
aba2fb6
Ethcore blockchain fixed
grbIzl Oct 17, 2019
fb92dbd
Cargo.lock pushed; doc comment added for reversed nonce
grbIzl Oct 17, 2019
612880e
Ethstore tests fixed
grbIzl Oct 17, 2019
9908bd6
Ethstore cli fixed
grbIzl Oct 17, 2019
46a7547
Miner fixed
grbIzl Oct 17, 2019
cff97d1
Snapshot tests are fixed
grbIzl Oct 17, 2019
a92327a
Single brackets removed
grbIzl Oct 17, 2019
51e2206
Machine fixed
grbIzl Oct 17, 2019
117a0f9
Verification fixed
grbIzl Oct 17, 2019
022472a
Executive state fixed
grbIzl Oct 17, 2019
9e31fb3
More single brackets removed
grbIzl Oct 18, 2019
4209bc6
Update version of parity-crypto
grbIzl Oct 22, 2019
bb7ac3e
Use published version 0.4.2 of parity-crypto
grbIzl Oct 23, 2019
0c0e9e5
New test in tx_filter fixed
grbIzl Oct 23, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
174 changes: 87 additions & 87 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ num_cpus = "1.2"
number_prefix = "0.2"
panic_hook = { path = "util/panic-hook" }
parity-bytes = "0.1"
parity-crypto = { version = "0.4.2", features = ["publickey"] }
parity-daemonize = "0.3"
parity-hash-fetch = { path = "updater/hash-fetch" }
parity-ipfs-api = { path = "ipfs" }
Expand Down
1 change: 1 addition & 0 deletions accounts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ edition = "2018"
ethkey = { path = "ethkey" }
ethstore = { path = "ethstore" }
log = "0.4"
parity-crypto = { version = "0.4.2", features = ["publickey"] }
parking_lot = "0.9"
serde = "1.0"
serde_derive = "1.0"
Expand Down
14 changes: 3 additions & 11 deletions accounts/ethkey/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
[package]
description = "Parity Ethereum Keys Generator"
name = "ethkey"
version = "0.3.0"
version = "0.4.0"
authors = ["Parity Technologies <admin@parity.io>"]

[dependencies]
edit-distance = "2.0"
parity-crypto = "0.4.0"
eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" }
ethereum-types = "0.8.0"
lazy_static = "1.0"
log = "0.4"
parity-wordlist = "1.3"
quick-error = "1.2.2"
rand = "0.7"
rustc-hex = "1.0"
serde = "1.0"
serde_derive = "1.0"
tiny-keccak = "1.4"
zeroize = "0.9.1"
parity-crypto = { version = "0.4.2", features = ["publickey"] }
parity-wordlist = "1.3"
1 change: 1 addition & 0 deletions accounts/ethkey/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ docopt = "1.0"
env_logger = "0.5"
ethkey = { path = "../" }
panic_hook = { path = "../../../util/panic-hook" }
parity-crypto = { version = "0.4.2", features = ["publickey"] }
parity-wordlist="1.2"
rustc-hex = "1.0"
serde = "1.0"
Expand Down
10 changes: 6 additions & 4 deletions accounts/ethkey/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ extern crate env_logger;
extern crate ethkey;
extern crate panic_hook;
extern crate parity_wordlist;
extern crate parity_crypto;
extern crate rustc_hex;
extern crate serde;
extern crate threadpool;
Expand All @@ -30,7 +31,8 @@ use std::num::ParseIntError;
use std::{env, fmt, process, io, sync};

use docopt::Docopt;
use ethkey::{KeyPair, Random, Brain, BrainPrefix, Prefix, Error as EthkeyError, Generator, sign, verify_public, verify_address, brain_recover};
use ethkey::{Brain, BrainPrefix, Prefix, brain_recover};
use parity_crypto::publickey::{KeyPair, Random, Error as EthkeyError, Generator, sign, verify_public, verify_address};
use rustc_hex::{FromHex, FromHexError};

const USAGE: &'static str = r#"
Expand Down Expand Up @@ -200,7 +202,7 @@ fn execute<S, I>(command: I) -> Result<String, Error> where I: IntoIterator<Item
let keypair = Brain::new(phrase).generate().expect("Brain wallet generator is infallible; qed");
(keypair, Some(phrase_info))
} else {
let secret = args.arg_secret_or_phrase.parse().map_err(|_| EthkeyError::InvalidSecret)?;
let secret = args.arg_secret_or_phrase.parse().map_err(|_| EthkeyError::InvalidSecretKey)?;
(KeyPair::from_secret(secret)?, None)
};
Ok(display(result, display_mode))
Expand Down Expand Up @@ -241,15 +243,15 @@ fn execute<S, I>(command: I) -> Result<String, Error> where I: IntoIterator<Item
};
Ok(display(result, display_mode))
} else if args.cmd_sign {
let secret = args.arg_secret.parse().map_err(|_| EthkeyError::InvalidSecret)?;
let secret = args.arg_secret.parse().map_err(|_| EthkeyError::InvalidSecretKey)?;
let message = args.arg_message.parse().map_err(|_| EthkeyError::InvalidMessage)?;
let signature = sign(&secret, &message)?;
Ok(format!("{}", signature))
} else if args.cmd_verify {
let signature = args.arg_signature.parse().map_err(|_| EthkeyError::InvalidSignature)?;
let message = args.arg_message.parse().map_err(|_| EthkeyError::InvalidMessage)?;
let ok = if args.cmd_public {
let public = args.arg_public.parse().map_err(|_| EthkeyError::InvalidPublic)?;
let public = args.arg_public.parse().map_err(|_| EthkeyError::InvalidPublicKey)?;
verify_public(&public, &signature, &message)?
} else if args.cmd_address {
let address = args.arg_address.parse().map_err(|_| EthkeyError::InvalidAddress)?;
Expand Down
12 changes: 7 additions & 5 deletions accounts/ethkey/src/brain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
// You should have received a copy of the GNU General Public License
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.

use keccak::Keccak256;
use super::{KeyPair, Generator, Secret};
use std::convert::Infallible;
use parity_crypto::publickey::{KeyPair, Generator, Secret};
use parity_crypto::Keccak256;
use parity_wordlist;

/// Simple brainwallet.
Expand All @@ -32,7 +33,7 @@ impl Brain {
}

impl Generator for Brain {
type Error = ::Void;
type Error = Infallible;

fn generate(&mut self) -> Result<KeyPair, Self::Error> {
let seed = self.0.clone();
Expand All @@ -45,7 +46,7 @@ impl Generator for Brain {
match i > 16384 {
false => i += 1,
true => {
if let Ok(pair) = Secret::from_unsafe_slice(&secret)
if let Ok(pair) = Secret::import_key(&secret)
.and_then(KeyPair::from_secret)
{
if pair.address()[0] == 0 {
Expand All @@ -61,7 +62,8 @@ impl Generator for Brain {

#[cfg(test)]
mod tests {
use {Brain, Generator};
use Brain;
use parity_crypto::publickey::Generator;

#[test]
fn test_brain() {
Expand Down
6 changes: 4 additions & 2 deletions accounts/ethkey/src/brain_prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.

use super::{Generator, KeyPair, Error, Brain};
use super::Brain;
use parity_crypto::publickey::{Generator, KeyPair, Error};
use parity_wordlist as wordlist;

/// Tries to find brain-seed keypair with address starting with given prefix.
Expand Down Expand Up @@ -59,7 +60,8 @@ impl Generator for BrainPrefix {

#[cfg(test)]
mod tests {
use {Generator, BrainPrefix};
use BrainPrefix;
use parity_crypto::publickey::Generator;

#[test]
fn prefix_generator() {
Expand Down
3 changes: 2 additions & 1 deletion accounts/ethkey/src/brain_recover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ use std::collections::HashSet;
use edit_distance::edit_distance;
use parity_wordlist;

use super::{Address, Brain, Generator};
use super::Brain;
use parity_crypto::publickey::{Address, Generator};

/// Tries to find a phrase for address, given the number
/// of expected words and a partial phrase.
Expand Down
189 changes: 0 additions & 189 deletions accounts/ethkey/src/crypto.rs

This file was deleted.

Loading