#[non_exhaustive]pub struct KmRefreshThresholds { /* private fields */ }crypto only.Expand description
KM Refresh packet-count thresholds (draft-sharabayko-srt-01 §6.1.6).
Implementations§
Source§impl KmRefreshThresholds
impl KmRefreshThresholds
Sourcepub const RECOMMENDED: KmRefreshThresholds
pub const RECOMMENDED: KmRefreshThresholds
The draft’s own recommended values (§6.1.6): 2^25 packets refresh
period, 4000 packets pre-announcement period.
Sourcepub fn new(
refresh_period: u64,
pre_announcement_period: u64,
) -> Result<Self, Error>
pub fn new( refresh_period: u64, pre_announcement_period: u64, ) -> Result<Self, Error>
Thresholds for refresh_period packets between switchovers and a
pre_announcement_period ahead of it.
§Errors
Error::InvalidField unless 0 < pre_announcement_period < refresh_period <= KEYSTREAM_PACKETS - pre_announcement_period: a zero period would
rotate on every packet, a pre-announcement at or past the refresh point would announce
the next key only once it had already replaced the current one, and a key kept for
KEYSTREAM_PACKETS (2^31) packets would repeat its keystream, because the cipher counter
follows the 31-bit packet sequence number.
Sourcepub const fn refresh_period(&self) -> u64
pub const fn refresh_period(&self) -> u64
Packets an active key is used for before switchover.
Sourcepub const fn pre_announcement_period(&self) -> u64
pub const fn pre_announcement_period(&self) -> u64
Packets before switchover the next key is announced, and after switchover the old key stays valid.