Fixes in TLS-F

This commit is contained in:
Alexey
2026-04-17 12:38:22 +03:00
parent 376f9b42fb
commit 947ef2beb7

View File

@@ -18,6 +18,9 @@ fn jitter_and_clamp_sizes(sizes: &[usize], rng: &SecureRandom) -> Vec<usize> {
.iter() .iter()
.map(|&size| { .map(|&size| {
let base = size.clamp(MIN_APP_DATA, MAX_APP_DATA); let base = size.clamp(MIN_APP_DATA, MAX_APP_DATA);
if base == MIN_APP_DATA || base == MAX_APP_DATA {
return base;
}
let jitter_range = ((base as f64) * 0.03).round() as i64; let jitter_range = ((base as f64) * 0.03).round() as i64;
if jitter_range == 0 { if jitter_range == 0 {
return base; return base;