31 const uint8_t
key[16];
36 { 0x01, 0x02, 0x03, 0x04, 0x05 },
37 { 0xb2, 0x39, 0x63, 0x05, 0xf0, 0x3d, 0xc0, 0x27 } },
40 { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 },
41 { 0x29, 0x3f, 0x02, 0xd4, 0x7f, 0x37, 0xc9, 0xb6 } },
44 { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 },
45 { 0x97, 0xab, 0x8a, 0x1b, 0xf0, 0xaf, 0xb9, 0x61 } },
48 { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
49 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
50 { 0x9a, 0xc7, 0xcc, 0x9a, 0x60, 0x9d, 0x1e, 0xf7 } },
56 uint8_t buf[8],
encrypted[8], decrypted[8];
67 printf(
"Keystream test %d (%d-bit key) failed.\n",
76 const uint8_t
key[] = { 0x01, 0x02, 0x03, 0x04, 0x05 };
87 printf(
"Round-trip test failed.\n");
95 const uint8_t
key[] = { 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10 };
106 printf(
"Inplace round-trip test failed.\n");
114 printf(
"Invalid key_bits should return error.\n");
119 printf(
"Test encryption/decryption success.\n");
static AVFormatContext * ctx
#define attribute_nonstring
#define i(width, name, range_min, range_max)
__device__ int printf(const char *,...)
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.
Utility Preprocessor macros.
Memory handling functions.
#define FF_ARRAY_ELEMS(a)
static const uint8_t encrypted[]
static attribute_nonstring const uint8_t plaintext[8]
static const struct @153110125012135250101343134266227221130305007164 test_vectors[]
const uint8_t keystream[8]