39 RC4(
const void* key,
size_t len)
49 void restart(
const void* key,
size_t len);
59 uint8_t sx = m_state[m_x];
61 uint8_t sy = m_state[m_y];
65 return (c ^ m_state[ix]);
75 for (
char* bp = (
char*) buf; n--; bp++)
85 void encrypt(
void* dest,
const void* src,
size_t n)
87 char* dp = (
char*) dest;
88 const char* sp = (
const char*) src;
89 while (n--) *dp++ =
encrypt(*sp++);
109 for (
char* bp = (
char*) buf; n--; bp++)
119 void decrypt(
void* dest,
const void* src,
size_t n)
121 char* dp = (
char*) dest;
122 const char* sp = (
const char*) src;
123 while (n--) *dp++ =
decrypt(*sp++);
127 uint8_t m_state[256];
RC4(const void *key, size_t len)
void encrypt(void *dest, const void *src, size_t n)
void restart(const void *key, size_t len)
void decrypt(void *dest, const void *src, size_t n)
void decrypt(void *buf, size_t n)
void encrypt(void *buf, size_t n)