Deduplicating crate dependencies (part 3 of n) (#11614)

* Deduplicating crate dependencies (part 3 of n, `tiny_keccak`, `tokio-timer`, and co) (#11613)

The change includes:
```
tiny-keccak
tokio-timer
textwrap
winapi
rand
rand_xorshift
scopeguard
url
```

* Update rpc/src/v1/helpers/secretstore.rs

Co-Authored-By: Andronik Ordian <write@reusable.software>

* Update util/network-devp2p/src/connection.rs

Co-Authored-By: Andronik Ordian <write@reusable.software>

Co-authored-by: Andronik Ordian <write@reusable.software>
This commit is contained in:
Valentin Shergin
2020-04-09 02:03:27 -07:00
committed by GitHub
parent 12cbe93fbe
commit a5820b6ef9
24 changed files with 67 additions and 93 deletions

View File

@@ -31,7 +31,7 @@ use mio::deprecated::{EventLoop, Handler, TryRead, TryWrite};
use mio::tcp::TcpStream;
use parity_bytes::Bytes;
use rlp::{Rlp, RlpStream};
use tiny_keccak::Keccak;
use tiny_keccak::{Keccak, Hasher};
use ethcore_io::{IoContext, StreamToken};
use network::Error;
@@ -329,12 +329,12 @@ impl EncryptedConnection {
(&mut key_material[32..64]).copy_from_slice(key_material_keccak.as_bytes());
let mac_encoder_key: Secret = Secret::copy_from_slice(&key_material[32..64]).expect("can create Secret from 32 bytes; qed");
let mut egress_mac = Keccak::new_keccak256();
let mut egress_mac = Keccak::v256();
let mut mac_material = H256::from_slice(&key_material[32..64]) ^ handshake.remote_nonce;
egress_mac.update(mac_material.as_bytes());
egress_mac.update(if handshake.originated { &handshake.auth_cipher } else { &handshake.ack_cipher });
let mut ingress_mac = Keccak::new_keccak256();
let mut ingress_mac = Keccak::v256();
mac_material = H256::from_slice(&key_material[32..64]) ^ handshake.nonce;
ingress_mac.update(mac_material.as_bytes());
ingress_mac.update(if handshake.originated { &handshake.ack_cipher } else { &handshake.auth_cipher });