mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 16:51:02 +00:00
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:
committed by
GitHub
parent
5ef7fc4ab5
commit
8068fdd2af
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user