aboutsummaryrefslogtreecommitdiffstats
path: root/src/emsa4.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-06-10 17:20:02 +0000
committerlloyd <[email protected]>2008-06-10 17:20:02 +0000
commitdec416d649715617e0eb66b18d69f6dbe9c308b3 (patch)
tree7ff26fe9cee0f11a15977106d985e78c01fb1e51 /src/emsa4.cpp
parent2aef9fa5bc25984a838a51a93ac0e918d2d1bbac (diff)
Pass a RNG reference to the EMSA encoder functions
Diffstat (limited to 'src/emsa4.cpp')
-rw-r--r--src/emsa4.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/emsa4.cpp b/src/emsa4.cpp
index 831afd590..6fb63fe0a 100644
--- a/src/emsa4.cpp
+++ b/src/emsa4.cpp
@@ -7,7 +7,6 @@
#include <botan/lookup.h>
#include <botan/look_pk.h>
#include <botan/bit_ops.h>
-#include <botan/libstate.h>
namespace Botan {
@@ -31,7 +30,8 @@ SecureVector<byte> EMSA4::raw_data()
* EMSA4 Encode Operation *
*************************************************/
SecureVector<byte> EMSA4::encoding_of(const MemoryRegion<byte>& msg,
- u32bit output_bits)
+ u32bit output_bits,
+ RandomNumberGenerator& rng)
{
const u32bit HASH_SIZE = hash->OUTPUT_LENGTH;
@@ -43,7 +43,7 @@ SecureVector<byte> EMSA4::encoding_of(const MemoryRegion<byte>& msg,
const u32bit output_length = (output_bits + 7) / 8;
SecureVector<byte> salt(SALT_SIZE);
- global_state().randomize(salt, SALT_SIZE);
+ rng.randomize(salt, SALT_SIZE);
for(u32bit j = 0; j != 8; ++j)
hash->update(0);