Introduce better hashing.

- Blake2 for secure hashing
- XX for fast hashing
This commit is contained in:
Gav
2018-01-19 14:17:56 +01:00
parent 748ee54870
commit c29313c618
24 changed files with 307 additions and 98 deletions
@@ -11,5 +11,4 @@ lazy_static = "1.0.0"
parking_lot = "0.5"
polkadot-state-machine = { path = "../../state_machine" , version = "0.1" }
environmental = { path = "../../environmental", version = "0.1.0" }
tiny-keccak = "1.3"
polkadot-primitives = { path = "../../primitives", version = "0.1.0" }
+1 -2
View File
@@ -1,7 +1,6 @@
#[macro_use]
extern crate environmental;
extern crate polkadot_state_machine;
extern crate tiny_keccak;
extern crate polkadot_primitives as primitives;
use std::fmt;
@@ -76,7 +75,7 @@ pub fn chain_id() -> u64 {
}
/// Conduct a Keccak-256 hash of the given data.
pub use tiny_keccak::keccak256;
pub use primitives::{blake2_256, twox_128, twox_256};
/// Verify a ed25519 signature.
pub fn ed25519_verify(sig: &[u8; 64], msg: &[u8], pubkey: &[u8; 32]) -> bool {