From 81d12879a4ec395e79aaf3be658d7a7b4e53e18f Mon Sep 17 00:00:00 2001 From: Monica Moniot Date: Wed, 16 Aug 2023 12:38:17 -0400 Subject: [PATCH] cargo fmt --- examples/benchmark.rs | 5 ++--- src/proto.rs | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/benchmark.rs b/examples/benchmark.rs index 30778ff..c570df9 100644 --- a/examples/benchmark.rs +++ b/examples/benchmark.rs @@ -8,13 +8,12 @@ use rand_core::OsRng; use rand_core::RngCore; use zssp::application::{ - AcceptAction, ApplicationLayer, IncomingSessionAction, RatchetState, RatchetStates, RatchetUpdate, - RATCHET_SIZE, + AcceptAction, ApplicationLayer, IncomingSessionAction, RatchetState, RatchetStates, RatchetUpdate, RATCHET_SIZE, }; use zssp::crypto::P384KeyPair; use zssp::crypto_impl::*; -use zssp::Session; use zssp::result::ReceiveError; +use zssp::Session; const TEST_MTU: usize = 1500; diff --git a/src/proto.rs b/src/proto.rs index e5a9249..da39de7 100644 --- a/src/proto.rs +++ b/src/proto.rs @@ -88,6 +88,7 @@ pub(crate) const LABEL_HEADER_KEY: &[u8; 4] = b"ASKH"; pub(crate) const LABEL_KEX_KEY: &[u8; 4] = b"ASKK"; pub(crate) const EXPIRE_AFTER_USES: u64 = 1 << 32 - 1; +pub(crate) const THREAD_SAFE_COUNTER_HARD_EXPIRE: u64 = u64::MAX - 1 << 16; /// Determines the number of counters a session will remember. If a counter arrives over /// this amount out of order relative to other received counters, it is likely to be /// rejected on the basis that the session can't remember if this counter was replayed. @@ -101,7 +102,6 @@ pub(crate) const COUNTER_WINDOW_MAX_SKIP_AHEAD: u64 = 1 << 24; /// When Bob issues a challenge to Alice to mitigate DDOS, Bob will only accept Alice's /// response once, and then its attached counter is added to the window. pub(crate) const CHALLENGE_COUNTER_WINDOW_MAX_OOO: usize = 32; -pub(crate) const THREAD_SAFE_COUNTER_HARD_EXPIRE: u64 = u64::MAX - 1 << 16; /* Packet constants */