58 for (
i = 0;
i < 12;
i++)
70 for (
i = 0;
i < 5;
i++)
72 for (
i = 6;
i < 11;
i++)
80 for (
i = 1;
i < 5;
i++) {
81 v = (v >> 16) | (v << 16);
92 for (
i = 4;
i > 0;
i--) {
94 v = (v >> 16) | (v << 16);
112 uint32_t
b =
data >> 32;
121 return ((uint64_t)
c << 32) |
tmp;
137 uint32_t
c =
data >> 32;
145 return ((uint64_t)
b << 32) |
a;
152 int num_qwords =
len >> 3;
153 uint8_t *qwords =
data;
154 uint64_t rc4buff[8] = { 0 };
156 uint32_t ms_keys[12];
176 packetkey =
AV_RN64(&qwords[num_qwords * 8 - 8]);
177 packetkey ^= rc4buff[7];
179 av_des_crypt(des, (uint8_t *)&packetkey, (uint8_t *)&packetkey, 1,
NULL, 1);
180 packetkey ^= rc4buff[6];
186 for (
i = 0;
i < num_qwords - 1;
i++, qwords += 8)
189 packetkey = (packetkey << 32) | (packetkey >> 32);
static uint32_t multiswap_step(const uint32_t keys[6], uint32_t v)
static uint64_t multiswap_dec(const uint32_t keys[12], uint64_t key, uint64_t data)
"MultiSwap" decryption
void ff_asfcrypt_dec(const uint8_t key[20], uint8_t *data, int len)
static uint64_t multiswap_enc(const uint32_t keys[12], uint64_t key, uint64_t data)
"MultiSwap" encryption
static void multiswap_init(const uint8_t keybuf[48], uint32_t keys[12])
read keys from keybuf into keys
static void multiswap_invert_keys(uint32_t keys[12])
invert the keys so that encryption become decryption keys and the other way round.
static uint32_t multiswap_inv_step(const uint32_t keys[6], uint32_t v)
#define i(width, name, range_min, range_max)
int av_des_init(AVDES *d, const uint8_t *key, int key_bits, av_unused int decrypt)
AVDES * av_des_alloc(void)
Allocate an AVDES context.
void av_des_crypt(AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt)
Encrypts / decrypts using the DES algorithm.
int av_rc4_init(AVRC4 *r, const uint8_t *key, int key_bits, int decrypt)
Initializes an AVRC4 context.
AVRC4 * av_rc4_alloc(void)
Allocate an AVRC4 context.
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.
Memory handling functions.