From af5c8294f5c2179b1451650de2f6bf247605a20e Mon Sep 17 00:00:00 2001 From: dxbjavid Date: Tue, 2 Jun 2026 12:35:18 +0530 Subject: [PATCH] widen r * p to u64 in scrypt params bounds check --- scrypt/src/params.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scrypt/src/params.rs b/scrypt/src/params.rs index 5fd458c6..3bae3cc8 100644 --- a/scrypt/src/params.rs +++ b/scrypt/src/params.rs @@ -96,7 +96,7 @@ impl Params { // check: p <= ((2^32-1) * 32) / (128 * r) // It takes a bit of re-arranging to get the check above into this form, // but it is indeed the same. - if r * p >= 0x4000_0000 { + if u64::from(r) * u64::from(p) >= 0x4000_0000 { return Err(InvalidParams); }