From a5820b6ef9663bbbffe10afab49b605efb3c3159 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Thu, 9 Apr 2020 02:03:27 -0700 Subject: [PATCH] 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 * Update util/network-devp2p/src/connection.rs Co-Authored-By: Andronik Ordian Co-authored-by: Andronik Ordian --- Cargo.lock | 73 +++++++--------------- Cargo.toml | 4 +- accounts/ethstore/Cargo.toml | 4 +- cli-signer/rpc-client/Cargo.toml | 2 +- ethcore/Cargo.toml | 6 +- ethcore/blockchain/Cargo.toml | 2 +- ethcore/engines/authority-round/Cargo.toml | 2 +- ethcore/engines/clique/Cargo.toml | 2 +- ethcore/light/Cargo.toml | 2 +- ethcore/private-tx/Cargo.toml | 4 +- ethcore/snapshot/Cargo.toml | 6 +- ethcore/snapshot/snapshot-tests/Cargo.toml | 4 +- ethcore/sync/Cargo.toml | 4 +- miner/Cargo.toml | 2 +- rpc/Cargo.toml | 8 +-- rpc/src/v1/helpers/secretstore.rs | 4 +- rpc/src/v1/impls/pubsub.rs | 8 +-- updater/Cargo.toml | 2 +- updater/hash-fetch/Cargo.toml | 2 +- util/fetch/Cargo.toml | 2 +- util/keccak-hasher/Cargo.toml | 2 +- util/keccak-hasher/src/lib.rs | 5 +- util/network-devp2p/Cargo.toml | 4 +- util/network-devp2p/src/connection.rs | 6 +- 24 files changed, 67 insertions(+), 93 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8c76c6c3c..2e02c0219 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -576,7 +576,7 @@ dependencies = [ "atty", "bitflags", "strsim 0.8.0", - "textwrap 0.11.0", + "textwrap", "unicode-width", "vec_map", ] @@ -1000,7 +1000,7 @@ dependencies = [ "rand 0.7.3", "rlp", "secp256k1", - "tiny-keccak 2.0.1", + "tiny-keccak 2.0.2", "zeroize", ] @@ -1318,7 +1318,7 @@ dependencies = [ "mio", "num_cpus", "parking_lot 0.10.0", - "slab 0.4.2", + "slab", "time", "timer", "tokio", @@ -1474,9 +1474,9 @@ dependencies = [ "secp256k1", "serde", "serde_json", - "slab 0.4.2", + "slab", "tempfile", - "tiny-keccak 1.5.0", + "tiny-keccak 2.0.2", ] [[package]] @@ -1522,7 +1522,7 @@ dependencies = [ "spec", "state-db", "time-utils", - "tiny-keccak 1.5.0", + "tiny-keccak 2.0.2", "trace", "transaction-pool", "trie-db", @@ -1695,7 +1695,7 @@ dependencies = [ "smallvec 1.2.0", "tempfile", "time", - "tiny-keccak 1.5.0", + "tiny-keccak 2.0.2", ] [[package]] @@ -2016,7 +2016,7 @@ dependencies = [ "http", "indexmap", "log", - "slab 0.4.2", + "slab", "string", "tokio-io", ] @@ -2187,7 +2187,7 @@ dependencies = [ "tokio-reactor", "tokio-tcp", "tokio-threadpool", - "tokio-timer 0.2.13", + "tokio-timer", "want", ] @@ -2512,7 +2512,7 @@ dependencies = [ "jsonrpc-server-utils", "log", "parking_lot 0.10.0", - "slab 0.4.2", + "slab", "ws", ] @@ -2533,7 +2533,7 @@ dependencies = [ "ethereum-types", "hash-db", "plain_hasher", - "tiny-keccak 1.5.0", + "tiny-keccak 2.0.2", ] [[package]] @@ -2910,7 +2910,7 @@ dependencies = [ "log", "miow 0.2.1", "net2", - "slab 0.4.2", + "slab", "winapi 0.2.8", ] @@ -2923,7 +2923,7 @@ dependencies = [ "lazycell", "log", "mio", - "slab 0.4.2", + "slab", ] [[package]] @@ -3220,7 +3220,7 @@ dependencies = [ "spec", "tempfile", "term_size", - "textwrap 0.9.0", + "textwrap", "toml", "verification", "winapi 0.3.8", @@ -3287,7 +3287,7 @@ dependencies = [ "secp256k1", "sha2", "subtle 2.2.2", - "tiny-keccak 2.0.1", + "tiny-keccak 2.0.2", "zeroize", ] @@ -3414,8 +3414,8 @@ dependencies = [ "spec", "stats", "tempfile", - "tiny-keccak 1.5.0", - "tokio-timer 0.1.2", + "tiny-keccak 2.0.2", + "tokio-timer", "trace", "transaction-pool", "transient-hashmap", @@ -4591,12 +4591,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e88f89a550c01e4cd809f3df4f52dc9e939f3273a2017eabd5c6d12fd98bb23" -[[package]] -name = "slab" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" - [[package]] name = "slab" version = "0.4.2" @@ -4926,15 +4920,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "textwrap" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693" -dependencies = [ - "unicode-width", -] - [[package]] name = "textwrap" version = "0.11.0" @@ -5008,9 +4993,9 @@ dependencies = [ [[package]] name = "tiny-keccak" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2953ca5148619bc99695c1274cb54c5275bbb913c6adad87e72eaf8db9787f69" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" dependencies = [ "crunchy", ] @@ -5044,7 +5029,7 @@ dependencies = [ "tokio-sync", "tokio-tcp", "tokio-threadpool", - "tokio-timer 0.2.13", + "tokio-timer", "tokio-udp", "tokio-uds", ] @@ -5139,7 +5124,7 @@ dependencies = [ "mio", "num_cpus", "parking_lot 0.9.0", - "slab 0.4.2", + "slab", "tokio-executor", "tokio-io", "tokio-sync", @@ -5205,20 +5190,10 @@ dependencies = [ "lazy_static", "log", "num_cpus", - "slab 0.4.2", + "slab", "tokio-executor", ] -[[package]] -name = "tokio-timer" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6131e780037787ff1b3f8aad9da83bca02438b72277850dd6ad0d455e0e20efc" -dependencies = [ - "futures", - "slab 0.3.0", -] - [[package]] name = "tokio-timer" version = "0.2.13" @@ -5227,7 +5202,7 @@ checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" dependencies = [ "crossbeam-utils", "futures", - "slab 0.4.2", + "slab", "tokio-executor", ] @@ -5825,7 +5800,7 @@ dependencies = [ "mio-extras", "rand 0.7.3", "sha-1", - "slab 0.4.2", + "slab", "url 2.1.1", ] diff --git a/Cargo.toml b/Cargo.toml index 0d0e01578..cdfa049b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -76,7 +76,7 @@ serde_json = "1.0" snapshot = { path = "ethcore/snapshot" } spec = { path = "ethcore/spec" } term_size = "0.3" -textwrap = "0.9" +textwrap = "0.11.0" toml = "0.5.6" verification = { path = "ethcore/verification" } @@ -90,7 +90,7 @@ tempfile = "3.1" fake-fetch = { path = "util/fake-fetch" } [target.'cfg(windows)'.dependencies] -winapi = { version = "0.3.4", features = ["winsock2", "winuser", "shellapi"] } +winapi = { version = "0.3.8", features = ["winsock2", "winuser", "shellapi"] } [features] default = ["accounts"] diff --git a/accounts/ethstore/Cargo.toml b/accounts/ethstore/Cargo.toml index 1c85028bb..031684506 100644 --- a/accounts/ethstore/Cargo.toml +++ b/accounts/ethstore/Cargo.toml @@ -8,13 +8,13 @@ repository = "https://github.com/openethereum/openethereum" [dependencies] log = "0.4" libc = "0.2" -rand = "0.7" +rand = "0.7.3" ethkey = { path = "../ethkey" } serde = "1.0" serde_json = "1.0" serde_derive = "1.0" rustc-hex = "2.1.0" -tiny-keccak = "1.4" +tiny-keccak = "2.0.2" time = "0.1.34" parking_lot = "0.10.0" parity-crypto = { version = "0.5.0", features = ["publickey"] } diff --git a/cli-signer/rpc-client/Cargo.toml b/cli-signer/rpc-client/Cargo.toml index 6bcb14704..ec86e0f44 100644 --- a/cli-signer/rpc-client/Cargo.toml +++ b/cli-signer/rpc-client/Cargo.toml @@ -12,7 +12,7 @@ futures = "0.1" log = "0.4" serde = "1.0" serde_json = "1.0" -url = "2.1.0" +url = "2.1.1" matches = "0.1" parking_lot = "0.10.0" jsonrpc-core = "14.0.3" diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 6f5b07f7d..15150d89b 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -44,13 +44,13 @@ pod = { path = "pod", optional = true } trie-db = "0.20.0" parity-crypto = { version = "0.5.0", features = ["publickey"], optional = true } patricia-trie-ethereum = { path = "../util/patricia-trie-ethereum" } -rand = "0.7" -rand_xorshift = "0.2" +rand = "0.7.3" +rand_xorshift = "0.2.0" rayon = "1.1" registrar = { path = "../util/registrar" } rlp = "0.4.0" rustc-hex = "2.1.0" -scopeguard = "1.0.0" +scopeguard = "1.1.0" serde = "1.0" serde_derive = "1.0" snapshot = { path = "snapshot" } diff --git a/ethcore/blockchain/Cargo.toml b/ethcore/blockchain/Cargo.toml index 55473326d..72a961974 100644 --- a/ethcore/blockchain/Cargo.toml +++ b/ethcore/blockchain/Cargo.toml @@ -19,7 +19,7 @@ itertools = "0.8.2" kvdb = "0.4.0" log = "0.4" parity-bytes = "0.1" -rand = "0.7" +rand = "0.7.3" parking_lot = "0.10.0" rayon = "1.0" rlp = "0.4.0" diff --git a/ethcore/engines/authority-round/Cargo.toml b/ethcore/engines/authority-round/Cargo.toml index 8094447dd..ced2473a0 100644 --- a/ethcore/engines/authority-round/Cargo.toml +++ b/ethcore/engines/authority-round/Cargo.toml @@ -28,7 +28,7 @@ lru-cache = "0.1" machine = { path = "../../machine" } parity-bytes = "0.1" parking_lot = "0.10.0" -rand = "0.7" +rand = "0.7.3" rlp = "0.4.0" time-utils = { path = "../../../util/time-utils" } unexpected = { path = "../../../util/unexpected" } diff --git a/ethcore/engines/clique/Cargo.toml b/ethcore/engines/clique/Cargo.toml index 5eedf0c70..150784699 100644 --- a/ethcore/engines/clique/Cargo.toml +++ b/ethcore/engines/clique/Cargo.toml @@ -18,7 +18,7 @@ lazy_static = "1.3.0" log = "0.4" lru-cache = "0.1" machine = { path = "../../machine" } -rand = "0.7" +rand = "0.7.3" parking_lot = "0.10.0" rlp = "0.4.0" time-utils = { path = "../../../util/time-utils" } diff --git a/ethcore/light/Cargo.toml b/ethcore/light/Cargo.toml index 3f225cc37..116012b13 100644 --- a/ethcore/light/Cargo.toml +++ b/ethcore/light/Cargo.toml @@ -33,7 +33,7 @@ rlp = "0.4.0" rlp-derive = "0.1" smallvec = "1.2.0" futures = "0.1" -rand = "0.7" +rand = "0.7.3" bincode = "1.1" serde = "1.0" serde_derive = "1.0" diff --git a/ethcore/private-tx/Cargo.toml b/ethcore/private-tx/Cargo.toml index 8a8104a97..02b1d2c18 100644 --- a/ethcore/private-tx/Cargo.toml +++ b/ethcore/private-tx/Cargo.toml @@ -45,10 +45,10 @@ serde_json = "1.0" spec = { path = "../spec" } state-db = { path = "../state-db" } time-utils = { path = "../../util/time-utils" } -tiny-keccak = "1.4" +tiny-keccak = "2.0.2" trace = { path = "../trace" } transaction-pool = "2.0.1" -url = "2" +url = "2.1.1" vm = { path = "../vm" } [dev-dependencies] diff --git a/ethcore/snapshot/Cargo.toml b/ethcore/snapshot/Cargo.toml index 1ff82383c..228232629 100644 --- a/ethcore/snapshot/Cargo.toml +++ b/ethcore/snapshot/Cargo.toml @@ -32,12 +32,12 @@ keccak-hasher = { path = "../../util/keccak-hasher" } kvdb = "0.4.0" log = "0.4.8" num_cpus = "1.10.1" -rand = "0.7" -rand_xorshift = "0.2" +rand = "0.7.3" +rand_xorshift = "0.2.0" parking_lot = "0.10.0" rlp = "0.4.2" rlp-derive = "0.1" -scopeguard = "1.0.0" +scopeguard = "1.1.0" snappy = { package = "parity-snappy", version ="0.1.0" } state-db = { path = "../state-db" } trie-db = "0.20.0" diff --git a/ethcore/snapshot/snapshot-tests/Cargo.toml b/ethcore/snapshot/snapshot-tests/Cargo.toml index 81a0674e3..bf1ba8e95 100644 --- a/ethcore/snapshot/snapshot-tests/Cargo.toml +++ b/ethcore/snapshot/snapshot-tests/Cargo.toml @@ -28,8 +28,8 @@ kvdb-rocksdb = "0.6.0" log = "0.4.8" parking_lot = "0.10.0" parity-crypto = { version = "0.5.0", features = ["publickey"] } -rand = "0.7" -rand_xorshift = "0.2" +rand = "0.7.3" +rand_xorshift = "0.2.0" rlp = "0.4.2" snappy = { package = "parity-snappy", version ="0.1.0" } snapshot = { path = "../../snapshot", features = ["test-helpers"] } diff --git a/ethcore/sync/Cargo.toml b/ethcore/sync/Cargo.toml index 3be4c002e..bcb30c677 100644 --- a/ethcore/sync/Cargo.toml +++ b/ethcore/sync/Cargo.toml @@ -28,7 +28,7 @@ network = { package = "ethcore-network", path = "../../util/network" } parity-runtime = "0.1.1" parity-crypto = { version = "0.5.0", features = ["publickey"] } parity-util-mem = "0.5.1" -rand = "0.7" +rand = "0.7.3" parking_lot = "0.10.0" rlp = "0.4.0" snapshot = { path = "../snapshot" } @@ -42,6 +42,6 @@ ethcore = { path = "..", features = ["test-helpers"] } ethcore-io = { path = "../../util/io", features = ["mio"] } kvdb-memorydb = "0.4.0" machine = { path = "../machine" } -rand_xorshift = "0.2" +rand_xorshift = "0.2.0" rustc-hex = "2.1.0" spec = { path = "../spec" } diff --git a/miner/Cargo.toml b/miner/Cargo.toml index e5ac531e1..36ebeba0b 100644 --- a/miner/Cargo.toml +++ b/miner/Cargo.toml @@ -11,7 +11,7 @@ authors = ["Parity Technologies "] ethash = { path = "../ethash", optional = true } fetch = { path = "../util/fetch", optional = true } hyper = { version = "0.12", optional = true } -url = { version = "2", optional = true } +url = { version = "2.1.1", optional = true } # Miner ansi_term = "0.11" diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 9857efec3..61961c395 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -12,8 +12,8 @@ ansi_term = "0.11" futures = "0.1.6" log = "0.4" order-stat = "0.1" -rand = "0.7" -rand_xorshift = "0.2" +rand = "0.7.3" +rand_xorshift = "0.2.0" rustc-hex = "2.1.0" semver = "0.9" serde = "1.0" @@ -21,8 +21,8 @@ serde_derive = "1.0" serde_json = "1.0" parking_lot = "0.10.0" tempfile = "3.1" -tiny-keccak = "1.4" -tokio-timer = "0.1" +tiny-keccak = "2.0.2" +tokio-timer = "0.2.13" transient-hashmap = "0.4" itertools = "0.8.2" diff --git a/rpc/src/v1/helpers/secretstore.rs b/rpc/src/v1/helpers/secretstore.rs index bdaf3ae3c..4c5f38fa6 100644 --- a/rpc/src/v1/helpers/secretstore.rs +++ b/rpc/src/v1/helpers/secretstore.rs @@ -23,7 +23,7 @@ use bytes::Bytes; use jsonrpc_core::Error; use v1::helpers::errors; use v1::types::EncryptedDocumentKey; -use tiny_keccak::Keccak; +use tiny_keccak::{Keccak, Hasher}; /// Initialization vector length. const INIT_VEC_LEN: usize = 16; @@ -95,7 +95,7 @@ pub fn decrypt_document_with_shadow(decrypted_secret: Public, common_point: Publ /// Calculate Keccak(ordered servers set) pub fn ordered_servers_keccak(servers_set: BTreeSet) -> H256 { - let mut servers_set_keccak = Keccak::new_keccak256(); + let mut servers_set_keccak = Keccak::v256(); for server in servers_set { servers_set_keccak.update(&server.0); } diff --git a/rpc/src/v1/impls/pubsub.rs b/rpc/src/v1/impls/pubsub.rs index 1036517df..c2e398785 100644 --- a/rpc/src/v1/impls/pubsub.rs +++ b/rpc/src/v1/impls/pubsub.rs @@ -17,7 +17,7 @@ //! Parity-specific PUB-SUB rpc implementation. use std::sync::Arc; -use std::time::Duration; +use std::time::{Duration, Instant}; use parking_lot::RwLock; use jsonrpc_core::{self as core, Result, MetaIoHandler}; @@ -43,12 +43,8 @@ impl> PubSubClient { let poll_manager = Arc::new(RwLock::new(GenericPollManager::new(rpc))); let pm2 = Arc::downgrade(&poll_manager); - let timer = tokio_timer::wheel() - .tick_duration(Duration::from_millis(500)) - .build(); - // Start ticking - let interval = timer.interval(Duration::from_millis(1000)); + let interval = tokio_timer::Interval::new(Instant::now() + Duration::from_millis(500), Duration::from_millis(1000)); executor.spawn(interval .map_err(|e| warn!("Polling timer error: {:?}", e)) .for_each(move |_| { diff --git a/updater/Cargo.toml b/updater/Cargo.toml index 5f10b80c9..a49665ca3 100644 --- a/updater/Cargo.toml +++ b/updater/Cargo.toml @@ -21,7 +21,7 @@ parity-bytes = "0.1" parity-hash-fetch = { path = "hash-fetch" } parity-path = "0.1" parity-version = { path = "../util/version" } -rand = "0.7" +rand = "0.7.3" parking_lot = "0.10.0" semver = "0.9" target_info = "0.1" diff --git a/updater/hash-fetch/Cargo.toml b/updater/hash-fetch/Cargo.toml index 21e5dac33..b097618f2 100644 --- a/updater/hash-fetch/Cargo.toml +++ b/updater/hash-fetch/Cargo.toml @@ -12,7 +12,7 @@ futures = "0.1" log = "0.4" mime = "0.3" mime_guess = "2.0.1" -rand = "0.7" +rand = "0.7.3" rustc-hex = "2.1.0" fetch = { path = "../../util/fetch" } parity-bytes = "0.1" diff --git a/util/fetch/Cargo.toml b/util/fetch/Cargo.toml index facbcd5ef..306c03601 100644 --- a/util/fetch/Cargo.toml +++ b/util/fetch/Cargo.toml @@ -13,7 +13,7 @@ hyper-rustls = "0.18" http = "0.1" log = "0.4" tokio = "0.1.22" -url = "2" +url = "2.1.1" bytes = "0.4" [features] diff --git a/util/keccak-hasher/Cargo.toml b/util/keccak-hasher/Cargo.toml index b10267f3a..34cb08bba 100644 --- a/util/keccak-hasher/Cargo.toml +++ b/util/keccak-hasher/Cargo.toml @@ -8,6 +8,6 @@ license = "GPL-3.0" [dependencies] ethereum-types = "0.8.0" -tiny-keccak = "1.4.2" +tiny-keccak = "2.0.2" hash-db = "0.15.0" plain_hasher = "0.2" diff --git a/util/keccak-hasher/src/lib.rs b/util/keccak-hasher/src/lib.rs index 4bdae483a..6513755ad 100644 --- a/util/keccak-hasher/src/lib.rs +++ b/util/keccak-hasher/src/lib.rs @@ -31,8 +31,11 @@ impl Hasher for KeccakHasher { type StdHasher = PlainHasher; const LENGTH: usize = 32; fn hash(x: &[u8]) -> Self::Out { + use tiny_keccak::Hasher; let mut out = [0; 32]; - Keccak::keccak256(x, &mut out); + let mut keccak256 = Keccak::v256(); + keccak256.update(x); + keccak256.finalize(&mut out); out.into() } } diff --git a/util/network-devp2p/Cargo.toml b/util/network-devp2p/Cargo.toml index b07f7ba3a..0e30012d9 100644 --- a/util/network-devp2p/Cargo.toml +++ b/util/network-devp2p/Cargo.toml @@ -28,13 +28,13 @@ parity-crypto = { version = "0.5.0", features = ["publickey"] } parity-path = "0.1" parity-snappy = "0.1" parking_lot = "0.10.0" -rand = "0.7" +rand = "0.7.3" rlp = "0.4.0" secp256k1 = "0.17" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" slab = "0.4.2" -tiny-keccak = "1.4" +tiny-keccak = "2.0.2" [dev-dependencies] assert_matches = "1.2" diff --git a/util/network-devp2p/src/connection.rs b/util/network-devp2p/src/connection.rs index 9b72f0c0e..32dba315d 100644 --- a/util/network-devp2p/src/connection.rs +++ b/util/network-devp2p/src/connection.rs @@ -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 });