diff --git a/wacore/src/messages.rs b/wacore/src/messages.rs index 4a2676dc6..241a22925 100644 --- a/wacore/src/messages.rs +++ b/wacore/src/messages.rs @@ -138,7 +138,9 @@ impl core::fmt::Write for Utf8Sink<'_> { impl MessageUtils { fn random_pad_len() -> u8 { use rand::RngExt; - let mut rng = rand::make_rng::(); + // The thread-local generator directly: seeding a fresh StdRng per + // plaintext ran a full ChaCha key schedule to produce one byte. + let mut rng = rand::rng(); // Uniform 1..=16, matching WA Web / whatsmeow (rand%16 + 1). The prior // `& 0x0F` with a 0->15 remap skewed toward 15 and never produced 16. (rng.random::() & 0x0F) + 1