summaryrefslogtreecommitdiff
path: root/randpool.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2021-06-17 17:23:18 -0400
committerJeffrey Walton <noloader@gmail.com>2021-06-17 17:23:18 -0400
commit89424327e5541ca433de0c332dfb8c0502776fbf (patch)
tree11e9ec3ccd1dc9223d66314d01fa6a1d12a97ad1 /randpool.cpp
parent7101e9e73a66a35a11a1389851e8097fa5339cc3 (diff)
downloadcryptopp-git-89424327e5541ca433de0c332dfb8c0502776fbf.tar.gz
Whitespace check-in
Diffstat (limited to 'randpool.cpp')
-rw-r--r--randpool.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/randpool.cpp b/randpool.cpp
index d76f878c..b1a4f215 100644
--- a/randpool.cpp
+++ b/randpool.cpp
@@ -107,7 +107,9 @@ void OldRandomPool::IncorporateEntropy(const byte *input, size_t length)
// Endian swapped on little-endian machines. This is different
// behavior from Crypto++ 5.4. Provide an override to correct it.
-word32 OldRandomPool::GenerateWord32 (word32 min, word32 max)
+// ConditionalByteReverse performs the correction on full words.
+// I am not sure this will affect a ranged word.
+word32 OldRandomPool::GenerateWord32 (word32 min, word32 max)
{
const word32 range = max-min;
const unsigned int maxBits = BitPrecision(range);
@@ -117,7 +119,6 @@ word32 OldRandomPool::GenerateWord32 (word32 min, word32 max)
do
{
GenerateBlock((byte *)&value, sizeof(value));
- // This is new
value = ConditionalByteReverse(BIG_ENDIAN_ORDER, value);
value = Crop(value, maxBits);
} while (value > range);