blob: 08b3fc68626ddb913abc5f3deda20695f63f6b7b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#ifndef RC4_NATIVE_HH
#define RC4_NATIVE_HH
#include <cstring>
class RC4_native
{
public:
// key_len of -1 means treat key_data as a null-terminated string
RC4_native(unsigned char const* key_data, int key_len = -1);
// out_data = 0 means to encrypt/decrypt in place
void process(unsigned char* in_data, size_t len,
unsigned char* out_data = 0);
private:
class RC4Key
{
public:
unsigned char state[256];
unsigned char x;
unsigned char y;
};
RC4Key key;
};
#endif // RC4_NATIVE_HH
|