[domistream] Tests: rustfmt

This commit is contained in:
2026-11-25 12:52:38 +01:00
parent 948f446a13
commit da1f3afd52
16 changed files with 1015 additions and 293 deletions
+3 -10
View File
@@ -388,11 +388,7 @@ pub mod gf {
let k = data.len();
let len = data[0].len();
(0..parity)
.map(|r| {
(0..len)
.map(|x| (0..k).fold(0u8, |acc, c| acc ^ mul(matrix[r * k + c], data[c][x])))
.collect()
})
.map(|r| (0..len).map(|x| (0..k).fold(0u8, |acc, c| acc ^ mul(matrix[r * k + c], data[c][x]))).collect())
.collect()
}
}
@@ -559,8 +555,7 @@ impl VideoHost {
p.push(0);
p.push(0x10);
p.push((block << 4) | (last_block << 6));
let fec_info =
(u32::from(fec_percentage) << 4) | ((shard_index as u32) << 12) | ((data_shards as u32) << 22);
let fec_info = (u32::from(fec_percentage) << 4) | ((shard_index as u32) << 12) | ((data_shards as u32) << 22);
p.extend_from_slice(&fec_info.to_le_bytes());
p
}
@@ -603,9 +598,7 @@ pub fn video_encrypt(key: &[u8; 16], counter: u64, frame_number: u32, plaintext:
iv[..8].copy_from_slice(&counter.to_le_bytes());
iv[11] = b'V';
let mut buf = plaintext.to_vec();
let tag = cipher
.encrypt_inout_detached(&iv.into(), b"", buf.as_mut_slice().into())
.expect("gcm encrypt");
let tag = cipher.encrypt_inout_detached(&iv.into(), b"", buf.as_mut_slice().into()).expect("gcm encrypt");
let mut out = iv.to_vec();
out.extend_from_slice(&frame_number.to_le_bytes());
out.extend_from_slice(tag.as_slice());