A few perf things.

This commit is contained in:
Adam Ierymenko 2021-11-16 14:17:53 -05:00
parent 7a99b48d23
commit afa493654f
No known key found for this signature in database
GPG key ID: C8877CF2D7A5D7F3
3 changed files with 3 additions and 2 deletions

View file

@ -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"

View file

@ -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);

View file

@ -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> {