The unified diff between revisions [92f17752..] and [4e40e885..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'src/randpool.cpp'
#
#
# patch "src/randpool.cpp"
# from [b7237c75b0d6168d7672ce0bc16679a7d5fcab71]
# to [ee4d60d4cf28a7075e1fc511de81f9af5494f8fa]
#
============================================================
--- src/randpool.cpp b7237c75b0d6168d7672ce0bc16679a7d5fcab71
+++ src/randpool.cpp ee4d60d4cf28a7075e1fc511de81f9af5494f8fa
@@ -1,10 +1,11 @@
/*************************************************
* Randpool Source File *
-* (C) 1999-2006 The Botan Project *
+* (C) 1999-2007 Jack Lloyd *
*************************************************/
#include <botan/randpool.h>
#include <botan/lookup.h>
+#include <botan/loadstor.h>
#include <botan/bit_ops.h>
#include <botan/util.h>
#include <algorithm>
@@ -27,7 +28,7 @@ SecureVector<byte> randpool_prf(MessageA
RANDPOOL_PRF_TAG tag,
const byte in[], u32bit length)
{
- mac->update((byte)tag);
+ mac->update(static_cast<byte>(tag));
mac->update(in, length);
return mac->final();
}
@@ -58,13 +59,12 @@ void Randpool::update_buffer()
*************************************************/
void Randpool::update_buffer()
{
- const u64bit timestamp = system_clock();
+ const u64bit timestamp = system_time();
for(u32bit j = 0; j != counter.size(); ++j)
if(++counter[j])
break;
- for(u32bit j = 0; j != 8; ++j)
- counter[j+4] = get_byte(j, timestamp);
+ store_be(timestamp, counter + 4);
SecureVector<byte> mac_val = randpool_prf(mac, GEN_OUTPUT,
counter, counter.size());