Commit Graph

69 Commits

Author SHA1 Message Date
Toralf Wittner e30839e85f Consolidate crypto functionality in `ethcore-crypto`. (#8432)
* Consolidate crypto functionality in `ethcore-crypto`.

- Move `ecdh`/`ecies` modules to `ethkey`.
- Refactor `ethcore-crypto` to use file per module.
- Replace `subtle` with `ethcore_crypto::is_equal`.
- Add `aes_gcm` module to `ethcore-crypto`.

* Rename `aes::{encrypt,decrypt,decrypt_cbc}` ...

... to `aes::{encrypt_128_ctr,decrypt_128_ctr,decrypt_128_cbc}`.
2018-05-05 11:02:33 +02:00
Andrew Jones 14361cc7b1 Move ethcore::Error to error_chain (#8386)
* WIP

* Convert Ethcore error to use error_chain

* Use error_chain for ImportError and BlockImportError

* Fix error pattern matches for error_chain in miner

* Implement explicit From for AccountsError

* Fix pattern matches for ErrorKinds

* Handle ethcore error_chain in light client

* Explicitly define Result type to avoid shadowing

* Fix remaining Error pattern matches

* Fix tab space formatting

* Helps if the tests compile

* Fix error chain matching after merge
2018-04-19 11:52:54 +02:00
Toralf Wittner 2b05eb43a9 Add `util/mem` to zero out memory on drop. (#8356)
* Add `util/mem` to zero out memory on drop.

* Remove nonsense.

* Remove `Into` impls for `Memzero`.

* Update ethereum-types and remove H256Mut.
2018-04-11 13:57:12 +02:00
Tomasz Drwięga 9108a3bb50 Bump ethabi & ethereum-types. (#8258)
* Bump ethabi & ethereum-types.

* Fix test.

* Fix hex encodings.
2018-04-02 12:12:52 +01:00
Niklas Adolfsson 1c2c683ae3 make docopt usage non-const (#8189) 2018-03-23 13:53:06 +09:00
Robert Habermeier 249f81cbc5 optional dependency on secp256k1 for ethcrypto (#8109)
* optional dependency on secp256k1 for ethcrypto

* README
2018-03-19 06:39:46 +01:00
Niklas Adolfsson 29d7a0e3c9 [ethkey] Unify debug/display for Address/Public/Secret (#8076)
* unify debug in ethkey

* fix tests
2018-03-09 16:32:20 +01:00
Svyatoslav Nikolsky 37bfcb737b SecretStore: threshold ECDSA PoC (#7615)
* SecretStore: ECDSA PoC

* SecretStore: fixed ECDSA serialization + cleanup

* removed unused param

* removed unused method

* removed debug unwrap

* 1/x -> inv(x)

* SecretStore: merged fixes from ECDSA session branch

* once again  1/* -> inv(*)

* fixed grumbles
2018-02-15 11:12:51 +01:00
Marek Kotewicz c060d9584d
ethabi version 5 (#7723)
* Refactor updater to use ethabi-derive

* Grumble: do_call type alias

* Empty commit to trigger test re-run

* migration to ethabi-5.0

* migration to ethabi-5.0 in progress

* use ethabi_deriven to generate TransactAcl contract

* use ethabi_deriven to generate Registry contract

* hash-fetch uses ethabi_derive, removed retain cycle from updater, fixed #7720

* node-filter crate uses ethabi_derive to generate peer_set contract interface

* use LruCache in node-filter instead of HashMap

* validator_set engine uses ethabi_derive

* ethcore does not depend on native_contracts

* miner does no depend on native_contracts

* secret_store does not use native_contracts (in progress)

* removed native-contracts

* ethcore and updater does not depend on futures

* updated ethereum-types

* fixed all warnings caused by using new version of ethereum-types

* updated ethabi_derive && ethabi_contract to get rid of warnings

* removed another retain cycle in updater, fixed following minor version on update

* moved contracts out of native_contracts res

* updated ethabi_contract

* fixed failing test

* fixed failing test

* there is no need to create two contracts of the same kind any more

* simplify updater::ReleaseTrack conversion into u8 and add several tests for it

* applied review suggestions

* applied review suggestions
2018-02-09 09:32:06 +01:00
Marek Kotewicz 51ef70922e
Moved panick_hook to util/panic_hook (#7629) 2018-01-20 20:28:25 +01:00
Marek Kotewicz 9adee532a0
bump some of our core dependencies (#7563)
* updated ethereum-types and tiny-keccak

* Updated several deps

* Updated several more dependencies

* Modify dummy file to trigger ci

* fixed update of memmap to 0.6 in ethash crate

* Fixed fetch after update to latest reqwest

* Updated jsonrpc-core with fixes for serde

* add expects in util/version/build.rs
2018-01-17 11:45:29 +01:00
Marek Kotewicz e95b093483 dissolve util (#7460)
* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor finished

* removed obsolete util/src/lib.rs

* removed commented out code
2018-01-10 15:35:18 +03:00
Tomasz Drwięga 7663451116 Assorted improvements for ethstore and ethkey (#6961)
* Testing many passwords for presale wallet.

* Add multiple threads.

* WiP: ethkey brain wallets recover.

* Refactor pre-sale-wallet cracking.

* Generate in multiple threads. Brain with prefix.

* Validate bain wallet phrase.

* Brain wallet recovery.

* Self-review fixes.

* Fix tests.

* More docs.

* Bump versions.

* Remove cmd_find from borked merge.

* Update wasm submodules.

* Use threadpool.
2017-12-01 11:40:07 +03:00
Arkadiy Paronyan 5b29b6d064 Squash remaining warnings (#6789)
* Fixed comment warnings

* Fixed remaining warnings
2017-10-16 12:31:52 +02:00
debris 455ecf700c updated tiny-keccak to 1.3 2017-08-07 10:06:02 +02:00
debris eecd823d32 util reexports less std 2017-07-29 21:10:14 +02:00
Brian Anderson 6345b54034 Add custom panic hook
The panic hook prints a backtrace, the panic message, file, and line
number, and a plea to report bugs.
2017-07-19 17:50:48 +00:00
Arkadiy Paronyan d9101b9559 Fixed ethkey CLI build (#6086) 2017-07-19 10:18:30 +02:00
Robert Habermeier 99075ad22a Initial Whisper implementation (#6009)
* whisper skeleton

* basic message store

* rallying and message logic

* pass host info to network protocol handlers

* choose who starts rally based on node key

* module reshuffling

* mining messages

* prune messages by low PoW until below size target

* associated error type for ethkey generators and `OsRng` generator

* beginnings of RPC

* generic message handler for whisper

* reshuffle code order

* standard payload encoding and decoding

* basic crypto

* minor restructuring of net code

* implement shh_post

* merge?

* implement filters

* rand trait for hash types

* filter RPCs for whisper

* symmetric encryption of payload

* pub-sub

* filter tests

* use only secure random IDs

* attach arbitrary protocols to network

* basic integration of whisper into Parity

* eagerly prune low PoW entries

* broadcast messages with salted topics

* node info RPC

* fix import

* fix leading zeros calculation

* address minor grumbles
2017-07-14 20:40:28 +02:00
Robert Habermeier 104367ce24 Merge pull request #5996 from paritytech/serdeup
migration to serde 1.0
2017-07-06 18:02:11 +02:00
Svyatoslav Nikolsky 6334893561 SecretStore: generating signatures (#5764)
* refactoring traits

* separate generation session

* generalized ClusterSessions

* signing session prototype

* full_signature_math_session

* consensus session prototype

* continue signing session

* continue signing session

* continue signing session

* continue signing session

* isolated consensus logic

* started work on signing test

* complete_gen_sign_session works

* consensus tests

* get rid of duplicated data in SigningSession

* TODOs in signing session

* fixing tests

* fixed last test

* signing session in http listener

* new key server tests

* fix after merge

* enabled warnings

* fixed possible race

* ignore previous jobs responses

* include sef node in consensus when confirmed

* fixed warning

* removed extra clones

* consensus_restarts_after_node_timeout

* encrypt signature before return

* return error text along with HTTP status

* fix for odd-of-N (share check fails + not equal to local sign)

* fixed t-of-N for odd t

* fixed test cases in complete_gen_sign_session

* fixed mistimed response reaction

* jobs draft

* DecryptionJob

* consensus session tets

* fixed decryption tests

* signing job implementation

* siginng_session using new consensus_session

* added license preambles

* same_consensus_group_returned_after_second_selection

* database upgrade v0 -> v1

* typo

* fixed grumbles
2017-07-06 14:02:10 +02:00
Marek Kotewicz 46183b1cdd bigint upgraded to version 3.0 (#5986)
* bigint upgraded to version 3.0

* fixed missing FromHex import in ethcore tests

* fixed missing FromHex import in rpc tests
2017-07-06 11:26:14 +02:00
debris 286526072f migrated ethkey, ethstore, evmbin and parity executables to serde 1.0 2017-07-04 14:31:16 +02:00
debris a9aaacd88b bigint upgraded to version 3.0 2017-07-04 12:19:11 +02:00
Marek Kotewicz c50dacff17 all executables are workspace members (#5865)
* ethstore-cli and ethkey-cli are workspace projects

* evmbin is now a workspace project
2017-06-19 11:29:09 +02:00
Tomasz Drwięga 9773aa4c76 Update Cid/multihash/ring/tinykeccak (#5785)
* Updating ring,multihash,tiny-keccak

* Updating CID in ipfs.
2017-06-07 12:31:12 +02:00
Nikolay Volf e1fef5c732 Update dependencies and bigint api (#5685)
* update to latest bigint

* bump elastic array and deps

* fix rlp tests

* also update all smallvec deps

* fix doc test

* reduce parking in attempt to fix CI bug

* fix from/into electum bug

* remove duplicate imports
2017-05-24 12:31:33 +02:00
Nikolay Volf 7499efecf6 fix from/into electum bug (#5686) 2017-05-24 11:53:02 +02:00
Tomasz Drwięga 3ff72794e5 Create an account for chain=dev (#5612)
* implement From<&'static str> for Secret

* Dev account.

* Fix Secret semantics.
2017-05-19 17:06:36 +02:00
Robert Habermeier 38ed39ebe0 Merge pull request #5591 from paritytech/relicense-rlp
relicense RLP to MIT/Apache2
2017-05-11 16:54:43 +02:00
Tomasz Drwięga feb7ac7ba8
Fix ethkey test. 2017-05-11 14:58:24 +02:00
Tomasz Drwięga fc3e1a4f18
Fix eth_sign signature encoding. 2017-05-11 12:47:47 +02:00
Robert Habermeier a2fe46f8b3 use bigint on crates.io 2017-05-10 13:16:24 +02:00
Tomasz Drwięga 28dcbc6426 Support external eth_sign (#5481)
* Display a QR for eth_sign requests.

* Support raw confirmation of eth_sign

* Fix ethkey issue on nightly.

* Fixing test.

* Fixing test.
2017-04-27 18:23:22 +02:00
Svyatoslav Nikolsky 93a6047912 Fixing secretstore TODOs - part 1 (#5386)
* ECDKG protocol prototype

* added test for enc/dec math

* get rid of decryption_session

* added licenses

* fix after merge

* get rid of unused serde dependency

* doc

* decryption session [without commutative enc]

* failed_dec_session

* fixed tests

* added commen

* added more decryption session tests

* helper to localize an issue

* more computations to localize error

* decryption_session::SessionParams

* added tests for EC math to localize problem

* secretstore network transport

* encryption_session_works_over_network

* network errors processing

* connecting to KeyServer

* licenses

* get rid of debug println-s

* fixed secretstore args

* encryption results are stored in KS database

* decryption protocol works over network

* enc/dec Session traits

* fixing warnings

* fix after merge

* on-chain ACL checker proto

* fixed compilation

* fixed compilation

* finally fixed <odd>-of-N-scheme

* temporary commented test

* 1-of-N works in math

* scheme 1-of-N works

* updated AclStorage with real contract ABI

* remove unnecessary unsafety

* fixed grumbles

* wakeup on access denied

* encrypt secretstore messages

* 'shadow' decryption

* fix grumbles

* lost files

* secretstore cli-options

* decryption seccion when ACL check failed on master

* disallow regenerating key for existing document

* removed obsolete TODO

* fix after merge

* switched to tokio_io

* fix after merge

* fix after merge

* fix after merge

* fix after merge

* fix after merge

* fixed test

* fix after merge
2017-04-08 11:26:16 +02:00
Svyatoslav Nikolsky c0c06fdc53 Secretstore over network (#4974)
* ECDKG protocol prototype

* added test for enc/dec math

* get rid of decryption_session

* added licenses

* fix after merge

* get rid of unused serde dependency

* doc

* decryption session [without commutative enc]

* failed_dec_session

* fixed tests

* added commen

* added more decryption session tests

* helper to localize an issue

* more computations to localize error

* decryption_session::SessionParams

* added tests for EC math to localize problem

* secretstore network transport

* encryption_session_works_over_network

* network errors processing

* connecting to KeyServer

* licenses

* get rid of debug println-s

* fixed secretstore args

* encryption results are stored in KS database

* decryption protocol works over network

* enc/dec Session traits

* fixing warnings

* fix after merge

* finally fixed <odd>-of-N-scheme

* temporary commented test

* 1-of-N works in math

* scheme 1-of-N works

* remove unnecessary unsafety

* fixed grumbles

* fix grumbles

* lost files
2017-04-03 11:13:51 +02:00
maciejhirsz 9bd3f10f41 Squashed: Public Node 2017-03-29 17:07:58 +02:00
Tomasz Drwięga d2394d3ac3 Updating paths to repos. (#5330)
* Updating paths to repos.

* Updating rotor and libusb

* Fixing other occurrences
2017-03-29 15:17:27 +02:00
Marek Kotewicz 64c098627e updating dependencies (#5028)
* updated docopt, env_logger, semver and regex crates

* updated parking_lot to 0.4

* fixed compiling on linux

* updated igd to 0.6

* updated jsonrpc

* fixed regex related compiler error on linux
2017-03-28 19:06:08 +02:00
Svyatoslav Nikolsky fddbc9e5cb Secretstore DKG protocol draft + distributed encryption/decryption tests (#4725)
* ECDKG protocol prototype

* added test for enc/dec math

* get rid of decryption_session

* added licenses

* fix after merge

* get rid of unused serde dependency

* doc

* decryption session [without commutative enc]

* failed_dec_session

* fixed tests

* added commen

* added more decryption session tests

* helper to localize an issue

* more computations to localize error

* decryption_session::SessionParams

* added tests for EC math to localize problem
2017-03-13 12:54:56 +01:00
Marek Kotewicz 3fe3353696 removed redundant FixedHash trait, fixes #4029 (#4866) 2017-03-11 22:58:15 +04:00
Svyatoslav Nikolsky cb168828a2 EC math functions (#4696)
* EC math functions

* moved math funs -> Secret methods
2017-03-02 12:27:41 +01:00
Nikolay Volf 494a0de1e2 Key derivation in ethstore & rpc (#4515)
* initial in secret store

* generation

* test

* refactor of the derivation

* signing

* account provider

* tests for account provider

* rpc types

* rpc types converts

* rpc tests

* fix warnings

* some extra docs

* derivate -> derive

* secret() -> as_raw()

* secret() -> as_raw() in rpc

* fix merge bug

* align with new serde changes
2017-02-15 16:56:15 +01:00
Nikolay Volf fea76c07f0 Arbitrary labels for extended keys (u32, H256 built-in) (#4438)
* extend derivatino to arbitrary labels

* fix review

* fix more obsolete comments

* hard test for h256

* fix using only 4 bytes from hash
2017-02-09 10:44:28 -05:00
Nikolay Volf e257e4e3bd Ethkey - extended keys (#4377)
* data structures initial

* hard derivation

* tabs, docs

* more docs

* soft private derivation

* public derivation

* finalize api, fix warnings

* use simple new()

* keypair api

* bump byteorder

* doc tweaks

* remove heavyness from tests

* added test vector infrastructure and examples

* initialization from seed to key pair

* add comment about panic
2017-02-05 10:17:03 -05:00
Gav Wood 8404edb656 Fix whitespace (#4299)
* Fix whitespace.

* Update copyright years/owner.

* Push release only for tags.
2017-01-25 18:51:41 +01:00
Nikolay Volf f807aa65a1 Secret - from hash function, also validate data (#4159)
* from hash for secret

* checked from_slice

* move assert

* remove fromhash
2017-01-16 16:50:20 +01:00
Tomasz Drwięga 21006da125 Get rid of unsafe code in ethkey, propagate incorrect Secret errors. (#4119)
* Implementing secret

* Fixing tests
2017-01-11 12:16:47 +01:00
Robert Habermeier 8125b5690c Port `try` macro to new `?` operator. (#3962)
* initial untry sweep

* restore try in ipc codegen, fix inference

* change a few missed try instances
2016-12-27 12:53:56 +01:00
keorn fa504e510f Merge branch 'master' into auth-bft 2016-12-12 21:28:46 +01:00