summaryrefslogtreecommitdiff
path: root/arc4.cpp
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2007-05-04 15:10:50 +0000
committerweidai <weidai11@users.noreply.github.com>2007-05-04 15:10:50 +0000
commit5ee13b48aacba73bd46eb3ce6bdc1328c709cdbc (patch)
treef27ba515a537694e503655577430ff6ce5d283f9 /arc4.cpp
parentafa89ae9818c260d4c2149731c6972cee1a01bed (diff)
downloadcryptopp-git-5ee13b48aacba73bd46eb3ce6bdc1328c709cdbc.tar.gz
use Weak1 namespace
Diffstat (limited to 'arc4.cpp')
-rw-r--r--arc4.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/arc4.cpp b/arc4.cpp
index 0beeb24b..b5c27309 100644
--- a/arc4.cpp
+++ b/arc4.cpp
@@ -7,11 +7,11 @@
// completely in the public domain.
#include "pch.h"
-#define CRYPTOPP_ENABLE_NAMESPACE_WEAK
+#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
#include "arc4.h"
NAMESPACE_BEGIN(CryptoPP)
-namespace Weak {
+namespace Weak1 {
void ARC4_TestInstantiations()
{
@@ -62,9 +62,10 @@ static inline unsigned int MakeByte(T &x, T &y, byte *s)
return s[(a+b) & 0xff];
}
-byte ARC4_Base::GenerateByte()
+void ARC4_Base::GenerateBlock(byte *output, size_t size)
{
- return MakeByte(m_x, m_y, m_state);
+ while (size--)
+ *output++ = MakeByte(m_x, m_y, m_state);
}
void ARC4_Base::ProcessData(byte *outString, const byte *inString, size_t length)