Use a NonZeroU64 since the periodicity cannot be zero
This commit is contained in:
parent
61d38fb6d9
commit
cac466f5ed
1 changed files with 3 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
use crate::canonicalization::canonicalize;
|
use crate::canonicalization::canonicalize;
|
||||||
use crate::ikm::InputKeyMaterial;
|
use crate::ikm::InputKeyMaterial;
|
||||||
|
use std::num::NonZeroU64;
|
||||||
|
|
||||||
pub(crate) type KdfFunction = dyn Fn(&str, &[u8]) -> Vec<u8>;
|
pub(crate) type KdfFunction = dyn Fn(&str, &[u8]) -> Vec<u8>;
|
||||||
|
|
||||||
|
@ -13,8 +14,8 @@ impl KeyContext {
|
||||||
self.periodicity = None;
|
self.periodicity = None;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_periodicity(&mut self, periodicity: u64) {
|
pub fn set_periodicity(&mut self, periodicity: NonZeroU64) {
|
||||||
self.periodicity = Some(periodicity);
|
self.periodicity = Some(periodicity.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn get_ctx_elems(&self, time_period: Option<u64>) -> Vec<Vec<u8>> {
|
pub(crate) fn get_ctx_elems(&self, time_period: Option<u64>) -> Vec<Vec<u8>> {
|
||||||
|
|
Loading…
Reference in a new issue