We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae65734 commit 6df1997Copy full SHA for 6df1997
1 file changed
src/algorithms/rsa.rs
@@ -182,13 +182,10 @@ fn blind<R: TryCryptoRng + ?Sized, K: PublicKeyParts>(
182
debug_assert_eq!(&key.n().clone().get(), n_params.modulus());
183
let bits = key.n_bits_precision();
184
185
- let mut r: BoxedUint = BoxedUint::one_with_precision(bits);
+ let mut r: BoxedUint = BoxedUint::zero_with_precision(bits);
186
let mut ir: Option<BoxedUint> = None;
187
while ir.is_none() {
188
r = BoxedUint::try_random_mod_vartime(rng, key.n()).map_err(|_| Error::Rng)?;
189
- if r.is_zero().into() {
190
- r = BoxedUint::one_with_precision(bits);
191
- }
192
193
// r^-1 (mod n)
194
ir = r.invert_mod(key.n()).into();
0 commit comments