diff options
author | lloyd <[email protected]> | 2008-05-24 19:14:00 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-05-24 19:14:00 +0000 |
commit | be4c408997cf182d974c33b1c62d7f6605c55f3e (patch) | |
tree | aad4126f540bdb24be1a20b765ca73dbacd2b38c /src/big_rand.cpp | |
parent | 117ee205ea987df26945e28373a66716fee06876 (diff) |
Remove random_integer() and replace it with a BigInt constructor taking a
RandomNumberGenerator reference. Update all callers.
Diffstat (limited to 'src/big_rand.cpp')
-rw-r--r-- | src/big_rand.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/big_rand.cpp b/src/big_rand.cpp index 5e6ec594b..b8cad3a4c 100644 --- a/src/big_rand.cpp +++ b/src/big_rand.cpp @@ -44,17 +44,6 @@ void BigInt::randomize(RandomNumberGenerator& rng, } /************************************************* -* Generate a random integer * -*************************************************/ -BigInt random_integer(RandomNumberGenerator& rng, - u32bit bits) - { - BigInt x; - x.randomize(rng, bits); - return x; - } - -/************************************************* * Generate a random integer within given range * *************************************************/ BigInt random_integer(RandomNumberGenerator& rng, @@ -65,7 +54,7 @@ BigInt random_integer(RandomNumberGenerator& rng, if(range <= 0) throw Invalid_Argument("random_integer: invalid min/max values"); - return (min + (random_integer(rng, range.bits() + 2) % range)); + return (min + (BigInt(rng, range.bits() + 2) % range)); } /************************************************* |