diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-08-11 12:52:45 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-08-11 14:32:13 +0200 |
commit | 614dd237fb428957b4a766f2c846524b7f91552b (patch) | |
tree | 212c84752d296f27a112143298573b9a67ecb7d7 | |
parent | b914ce71ee71477fb6e9cefc916ece157943917d (diff) |
openpgp: Improve test.
- Reduce the range of input values to increase the chance of finding
errors.
-rw-r--r-- | openpgp/src/crypto/s2k.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/openpgp/src/crypto/s2k.rs b/openpgp/src/crypto/s2k.rs index 0bc64af4..c56ab903 100644 --- a/openpgp/src/crypto/s2k.rs +++ b/openpgp/src/crypto/s2k.rs @@ -489,11 +489,11 @@ mod tests { } quickcheck!{ - fn s2k_coded_count_approx(i: usize) -> bool { - let approx = S2K::nearest_hash_count(i); + fn s2k_coded_count_approx(i: u32) -> bool { + let approx = S2K::nearest_hash_count(i as usize); let cc = S2K::encode_count(approx).unwrap(); - (approx as usize >= i || i > 0x3e00000) && S2K::decode_count(cc) == approx + (approx >= i || i > 0x3e00000) && S2K::decode_count(cc) == approx } } } |