Commit 68a61856 authored by asynchronous rob's avatar asynchronous rob Committed by GitHub
Browse files

Fix sync: ensure block hash gets read from the DB correctly (#152)

* update bootnodes

* fix block_hash loading

* test block hash gets inserted correctly

* specify revision to pull kvdb-memorydb from

* update parity repo dep
parent 9458afca
......@@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Parity Technologies <robert@parity.io>"]
[dependencies]
ethcore-crypto = { git = "https://github.com/paritytech/parity", default_features = false }
ethcore-crypto = { git = "https://github.com/paritytech/parity.git", default_features = false }
ed25519 = { path = "../../substrate/ed25519" }
error-chain = "0.11"
hex = "0.3"
......
......@@ -91,7 +91,8 @@ impl EncryptedKey {
let mut ciphertext = vec![0; PKCS_LEN];
// aes-128-ctr with initial vector of iv
crypto::aes::encrypt(&derived_left_bits, &iv, plain, &mut *ciphertext);
crypto::aes::encrypt_128_ctr(&derived_left_bits, &iv, plain, &mut *ciphertext)
.expect("input lengths of key and iv are both 16; qed");
// KECCAK(DK[16..31] ++ <ciphertext>), where DK[16..31] - derived_right_bits
let mac = crypto::derive_mac(&derived_right_bits, &*ciphertext).keccak256();
......@@ -116,7 +117,8 @@ impl EncryptedKey {
}
let mut plain = [0; PKCS_LEN];
crypto::aes::decrypt(&derived_left_bits, &self.iv, &self.ciphertext, &mut plain[..]);
crypto::aes::decrypt_128_ctr(&derived_left_bits, &self.iv, &self.ciphertext, &mut plain[..])
.expect("input lengths of key and iv are both 16; qed");
Ok(plain)
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment