mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-04-26 17:03:43 +02:00
A few perf things.
This commit is contained in:
parent
7a99b48d23
commit
afa493654f
3 changed files with 3 additions and 2 deletions
|
@ -18,7 +18,7 @@ gcrypt = "0.7.0"
|
|||
x25519-dalek = { version = "1.2.0", features = ["u64_backend"] }
|
||||
ed25519-dalek = { version = "1.0.1", features = ["u64_backend"] }
|
||||
heapless = "0.7.7"
|
||||
subtle = "^2"
|
||||
subtle = "2.4.1"
|
||||
|
||||
[dev-dependencies]
|
||||
quickcheck = "^1"
|
||||
|
|
|
@ -13,7 +13,6 @@ use crate::secret::Secret;
|
|||
/// This is a fixed cost key derivation function used to derive sub-keys from a single original
|
||||
/// shared secret for different uses, such as the K0/K1 in AES-GMAC-SIV.
|
||||
/// Key must be 384 bits in length.
|
||||
#[inline(always)]
|
||||
pub fn zt_kbkdf_hmac_sha384(key: &[u8], label: u8, context: u8, iter: u32) -> Secret<{ SHA384_HASH_SIZE }> {
|
||||
debug_assert_eq!(key.len(), SHA384_HASH_SIZE);
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
use std::sync::atomic::{AtomicI64, Ordering};
|
||||
|
||||
/// Boolean rate limiter with normal (non-atomic) semantics.
|
||||
#[repr(transparent)]
|
||||
pub struct IntervalGate<const FREQ: i64>(i64);
|
||||
|
||||
impl<const FREQ: i64> Default for IntervalGate<FREQ> {
|
||||
|
@ -35,6 +36,7 @@ impl<const FREQ: i64> IntervalGate<FREQ> {
|
|||
}
|
||||
|
||||
/// Boolean rate limiter with atomic semantics.
|
||||
#[repr(transparent)]
|
||||
pub struct AtomicIntervalGate<const FREQ: i64>(AtomicI64);
|
||||
|
||||
impl<const FREQ: i64> Default for AtomicIntervalGate<FREQ> {
|
||||
|
|
Loading…
Add table
Reference in a new issue