10 #define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
13 NAMESPACE_BEGIN(CryptoPP)
16 void ARC4_TestInstantiations()
21 ARC4_Base::~ARC4_Base()
26 void ARC4_Base::UncheckedSetKey(
const byte *key,
unsigned int keyLen,
const NameValuePairs ¶ms)
28 AssertValidKeyLength(keyLen);
37 unsigned int keyIndex = 0, stateIndex = 0;
40 unsigned int a = m_state[i];
41 stateIndex += key[keyIndex] + a;
43 m_state[i] = m_state[stateIndex];
44 m_state[stateIndex] = a;
45 if (++keyIndex >= keyLen)
54 static inline unsigned int MakeByte(T &x, T &y, byte *s)
56 unsigned int a = s[x];
58 unsigned int b = s[y];
62 return s[(a+b) & 0xff];
68 *output++ = MakeByte(m_x, m_y, m_state);
76 byte *
const s = m_state;
80 if (inString == outString)
84 *outString++ ^= MakeByte(x, y, s);
91 *outString++ = *inString++ ^ MakeByte(x, y, s);
105 byte *
const s = m_state;
106 unsigned int x = m_x;
107 unsigned int y = m_y;