10 #define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 16 #if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) 17 void ARC4_TestInstantiations()
23 ARC4_Base::~ARC4_Base()
39 unsigned int keyIndex = 0, stateIndex = 0;
43 stateIndex += key[keyIndex] +
a;
47 if (++keyIndex >= keyLen)
56 static inline unsigned int MakeByte(
T &
x,
T &y,
byte *s)
58 unsigned int a = s[
x];
59 y =
byte((y+a) & 0xff);
60 unsigned int b = s[y];
63 x =
byte((x+1) & 0xff);
64 return s[(a+
b) & 0xff];
82 if (inString == outString)
86 *outString++ ^= MakeByte(x, y, s);
93 *outString++ = *inString++ ^
byte(MakeByte(x, y, s));
108 unsigned int x =
m_x;
109 unsigned int y =
m_y;
void GenerateBlock(byte *output, size_t size)
Generate random array of bytes.
void ProcessData(byte *outString, const byte *inString, size_t length)
Encrypt or decrypt an array of bytes.
#define NAMESPACE_BEGIN(x)
void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms)
Sets the key for this object without performing parameter validation.
FixedSizeSecBlock< byte, 256 > m_state
CRYPTOPP_DLL int GetIntValueWithDefault(const char *name, int defaultValue) const
Get a named value with type int, with default.
void AssertValidKeyLength(size_t length) const
Validates the key length.
void DiscardBytes(size_t n)
Generate and discard n bytes.
virtual unsigned int GetDefaultDiscardBytes() const
uint8_t const size_t const size
Interface for retrieving values given their names.