chore(fmt): rustfmt drift cleanup across misc crates
Pure formatter output — no semantic changes. Sweeping these into their own commit so the FIPS integration diff that follows stays scoped to the actual feature. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
7655a5971b
commit
46350f48b6
@@ -285,10 +285,7 @@ impl RatchetState {
|
||||
if let Some(mut chain_key) = self.chain_key_recv {
|
||||
while self.recv_n < until {
|
||||
let (new_chain_key, message_key) = kdf_chain_key(&chain_key)?;
|
||||
let dh_hex = self
|
||||
.dh_remote_public
|
||||
.map(hex::encode)
|
||||
.unwrap_or_default();
|
||||
let dh_hex = self.dh_remote_public.map(hex::encode).unwrap_or_default();
|
||||
self.skipped_keys.insert((dh_hex, self.recv_n), message_key);
|
||||
chain_key = new_chain_key;
|
||||
self.recv_n += 1;
|
||||
|
||||
@@ -20,8 +20,7 @@ use serde::{Deserialize, Serialize};
|
||||
pub const STEGO_MARKER: u8 = 0xAA;
|
||||
|
||||
/// Steganography mode — how real payload bytes are disguised on the wire.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Default)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
pub enum SteganographyMode {
|
||||
/// No steganography — standard 0x02 typed envelope.
|
||||
#[default]
|
||||
@@ -34,7 +33,6 @@ pub enum SteganographyMode {
|
||||
SensorNetwork,
|
||||
}
|
||||
|
||||
|
||||
impl SteganographyMode {
|
||||
pub fn from_u8(v: u8) -> Option<Self> {
|
||||
match v {
|
||||
@@ -276,13 +274,11 @@ pub fn wire_size(mode: SteganographyMode, payload_len: usize) -> usize {
|
||||
match mode {
|
||||
SteganographyMode::Normal => payload_len,
|
||||
SteganographyMode::WeatherStation => {
|
||||
let blocks =
|
||||
payload_len.div_ceil(WEATHER_REAL_BYTES_PER_BLOCK);
|
||||
let blocks = payload_len.div_ceil(WEATHER_REAL_BYTES_PER_BLOCK);
|
||||
header + blocks * WEATHER_WIRE_BYTES_PER_BLOCK
|
||||
}
|
||||
SteganographyMode::SensorNetwork => {
|
||||
let blocks =
|
||||
payload_len.div_ceil(SENSOR_REAL_BYTES_PER_BLOCK);
|
||||
let blocks = payload_len.div_ceil(SENSOR_REAL_BYTES_PER_BLOCK);
|
||||
header + blocks * SENSOR_WIRE_BYTES_PER_BLOCK
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user