pub struct TimeLockParams {
pub time_precision: u8,
pub time_format: u8,
pub cadence_variant: u8,
pub salts: TimeLockSalts,
pub kdf_params: KdfParams,
}Expand description
Compact, self-contained encoding of all encryption-time settings — suitable for plaintext storage within a ciphertext header.
Produced by pack and supplied to timelock or
timelock_async as params: Some(header) on the
decryption side. Only the cadence variant discriminant is recorded; the
actual calendar values (weekday, day-of-month, month) are not stored and
are instead read from the live system clock during decryption.
| Field | Encoding / Notes |
|---|---|
time_precision | 0=Hour · 1=Quarter · 2=Minute |
time_format | 0=12 hr (Hour12) · 1=24 hr (Hour24) |
cadence_variant | 0=None · 1=DayOfWeek · 2=DayOfMonth |
3=MonthOfYear · 4=DayOfWeekInMonth | |
5=DayOfMonthInMonth · 6=DayOfWeekAndDayOfMonth | |
salts | Three 32-byte salts (not secret; prevent precomputation) |
kdf_params | Argon2id + scrypt work factors |
Fields§
§time_precision: u80 = TimePrecision::Hour,
1 = TimePrecision::Quarter,
2 = TimePrecision::Minute.
time_format: u80 = TimeFormat::Hour12 (12-hour clock),
1 = TimeFormat::Hour24 (24-hour clock).
cadence_variant: u8TimeLockCadence variant discriminant (0–6). The actual calendar
values for that variant (which weekday, which month, etc.) are
not stored here — the decryption path reads them from the clock.
salts: TimeLockSaltsThree KDF salts generated at encryption time.
Salts are not secret; storing them in the header is standard practice and prevents precomputation attacks.
kdf_params: KdfParamsThe KDF work-factor parameters used at encryption time.
Stored so the decryption side uses identical memory and iteration costs.
Trait Implementations§
Source§impl Clone for TimeLockParams
impl Clone for TimeLockParams
Source§fn clone(&self) -> TimeLockParams
fn clone(&self) -> TimeLockParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more