2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-03 10:50:53 +00:00
qpdf/libqpdf/qpdf/RC4_native.hh

29 lines
569 B
C++
Raw Normal View History

2019-11-04 14:04:25 +00:00
#ifndef RC4_NATIVE_HH
#define RC4_NATIVE_HH
2019-11-04 14:04:25 +00:00
#include <cstring>
2019-11-04 14:04:25 +00:00
class RC4_native
{
public:
// key_len of -1 means treat key_data as a null-terminated string
2019-11-04 14:04:25 +00:00
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;
};
2019-11-04 14:04:25 +00:00
#endif // RC4_NATIVE_HH