summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2007-02-03 13:23:18 +0000
committerMatt Johnston <matt@ucc.asn.au>2007-02-03 13:23:18 +0000
commitd0533106a8a5bfb81f1e95931db5a1a71ee11006 (patch)
treee7a682003996f4268076a16269f62fd8c6417cda
parent28f1026de851c17b2b0bfbefaf07e2f52e29ac4b (diff)
Remove extraneous tests in random mpint generation,
courtesy of Klocwork --HG-- extra : convert_revision : 2b5e1d92fd1ce08361e69155a525fca481e79fe4
-rw-r--r--random.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/random.c b/random.c
index c836de9..36fedff 100644
--- a/random.c
+++ b/random.c
@@ -234,8 +234,7 @@ void gen_random_mpint(mp_int *max, mp_int *rand) {
/* keep regenerating until we get one satisfying
* 0 < rand < max */
- } while ( ( (max != NULL) && (mp_cmp(rand, max) != MP_LT) )
- || (mp_cmp_d(rand, 0) != MP_GT) );
+ } while (mp_cmp(rand, max) != MP_LT);
m_burn(randbuf, len);
m_free(randbuf);
}