aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-05-25 20:51:30 +0000
committerlloyd <[email protected]>2008-05-25 20:51:30 +0000
commit89e20a742ada5000c8a78fbbf0bf8bd3b13565eb (patch)
tree8a9438a306d7da2b48a5874e1244754ffd665a75
parent9095f6b374691f829eb3fc62610baa30f295eb1a (diff)
Use RNG argument in EME_PKCS1v15::pad instead of global object
-rw-r--r--src/eme_pkcs.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/eme_pkcs.cpp b/src/eme_pkcs.cpp
index e6c9ae2d2..cd82c09d3 100644
--- a/src/eme_pkcs.cpp
+++ b/src/eme_pkcs.cpp
@@ -4,7 +4,6 @@
*************************************************/
#include <botan/eme.h>
-#include <botan/libstate.h>
namespace Botan {
@@ -13,7 +12,7 @@ namespace Botan {
*************************************************/
SecureVector<byte> EME_PKCS1v15::pad(const byte in[], u32bit inlen,
u32bit olen,
- RandomNumberGenerator&) const
+ RandomNumberGenerator& rng) const
{
olen /= 8;
@@ -27,7 +26,7 @@ SecureVector<byte> EME_PKCS1v15::pad(const byte in[], u32bit inlen,
out[0] = 0x02;
for(u32bit j = 1; j != olen - inlen - 1; ++j)
while(out[j] == 0)
- out[j] = global_state().random();
+ out[j] = rng.random();
out.copy(olen - inlen, in, inlen);
return out;