33 int keylen = key_bits >> 3;
36 for (i = 0; i < 256; i++)
40 for (j = 0, i = 0; i < 256; i++, j++) {
41 if (j == keylen) j = 0;
42 y += state[i] + key[j];
56 *dst++ = src ? *src++ ^ state[sum] : state[sum];
void av_rc4_crypt(AVRC4 *r, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt)
Encrypts / decrypts using the RC4 algorithm.
common internal and external API header
int av_rc4_init(AVRC4 *r, const uint8_t *key, int key_bits, int decrypt)
Initializes an AVRC4 context.
#define FFSWAP(type, a, b)