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
This commit is contained in:
Robert Habermeier
2018-05-11 15:46:54 +02:00
committed by GitHub
parent 5ef7fc4ab5
commit 8068fdd2af
7 changed files with 169 additions and 64 deletions
+4 -2
View File
@@ -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)
}
}