summaryrefslogtreecommitdiff
path: root/rng.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-09-20 18:43:51 -0400
committerJeffrey Walton <noloader@gmail.com>2017-09-20 18:43:51 -0400
commite4498a105ed292ee9efb1adc9e62b55dd0a110a7 (patch)
tree46259e69fe1af8ce6237846bb842c543ddda3bb2 /rng.cpp
parent4b7549a990f5bdaddb3b76f6caf4e817a02871f1 (diff)
downloadcryptopp-git-e4498a105ed292ee9efb1adc9e62b55dd0a110a7.tar.gz
Use ::time() and ::log() instead of std::time() and std::log() (GH #512)
The 35c0fa82fd4c change broke GCC 4.8
Diffstat (limited to 'rng.cpp')
-rw-r--r--rng.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/rng.cpp b/rng.cpp
index 43d48e28..9a09b59c 100644
--- a/rng.cpp
+++ b/rng.cpp
@@ -76,7 +76,7 @@ X917RNG::X917RNG(BlockTransformation *c, const byte *seed, const byte *determini
if (!deterministicTimeVector)
{
- time_t tstamp1 = std::time(NULLPTR);
+ time_t tstamp1 = ::time(NULLPTR);
xorbuf(m_datetime, (byte *)&tstamp1, UnsignedMin(sizeof(tstamp1), m_size));
m_cipher->ProcessBlock(m_datetime);
clock_t tstamp2 = clock();
@@ -102,7 +102,7 @@ void X917RNG::GenerateIntoBufferedTransformation(BufferedTransformation &target,
{
clock_t c = clock();
xorbuf(m_datetime, (byte *)&c, UnsignedMin(sizeof(c), m_size));
- time_t t = std::time(NULLPTR);
+ time_t t = ::time(NULLPTR);
xorbuf(m_datetime+m_size-UnsignedMin(sizeof(t), m_size), (byte *)&t, UnsignedMin(sizeof(t), m_size));
m_cipher->ProcessBlock(m_datetime);
}
@@ -142,7 +142,7 @@ size_t MaurerRandomnessTest::Put2(const byte *inString, size_t length, int /*mes
{
byte inByte = *inString++;
if (n >= Q)
- sum += std::log(double(n - tab[inByte]));
+ sum += ::log(double(n - tab[inByte]));
tab[inByte] = n;
n++;
}
@@ -154,7 +154,7 @@ double MaurerRandomnessTest::GetTestValue() const
if (BytesNeeded() > 0)
throw Exception(Exception::OTHER_ERROR, "MaurerRandomnessTest: " + IntToString(BytesNeeded()) + " more bytes of input needed");
- double fTu = (sum/(n-Q))/std::log(2.0); // this is the test value defined by Maurer
+ double fTu = (sum/(n-Q))/::log(2.0); // this is the test value defined by Maurer
double value = fTu * 0.1392; // arbitrarily normalize it to
return value > 1.0 ? 1.0 : value; // a number between 0 and 1