Skip to content

Commit

Permalink
Whitespace check-in
Browse files Browse the repository at this point in the history
  • Loading branch information
noloader committed Jun 17, 2021
1 parent 7101e9e commit 8942432
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions randpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 8942432

Please sign in to comment.