27 int main(
int argc,
char **argv)
31 static const uint8_t rkey[2][16] = {
33 { 0x10, 0xa5, 0x88, 0x69, 0xd7, 0x4b, 0xe5, 0xa3,
34 0x74, 0xcf, 0x86, 0x7c, 0xfb, 0x47, 0x38, 0x59 }
36 static const uint8_t rpt[2][16] = {
37 { 0x6a, 0x84, 0x86, 0x7c, 0xd7, 0x7e, 0x12, 0xad,
38 0x07, 0xea, 0x1b, 0xe8, 0x95, 0xc5, 0x3f, 0xa3 },
41 static const uint8_t rct[2][16] = {
42 { 0x73, 0x22, 0x81, 0xc0, 0xa0, 0xaa, 0xb8, 0xf7,
43 0xa5, 0x4a, 0x0c, 0x67, 0xa0, 0xc4, 0x5e, 0xcf },
44 { 0x6d, 0x25, 0x1e, 0x69, 0x44, 0xb0, 0x51, 0xe0,
45 0x4e, 0xaa, 0x6f, 0xb4, 0xdb, 0xf7, 0x84, 0x65 }
58 for (i = 0; i < 2; i++) {
61 for (j = 0; j < 16; j++) {
62 if (rpt[i][j] != temp[j]) {
64 j, rpt[i][j], temp[j]);
71 if (argc > 1 && !strcmp(argv[1],
"-t")) {
72 struct AVAES *ae, *ad;
88 for (i = 0; i < 10000; i++) {
89 for (j = 0; j < 32; j++)
91 for (j = 0; j < 16; j++)
98 temp[0], temp[5], temp[10], temp[15]);
103 temp[0], temp[5], temp[10], temp[15]);
107 for (j = 0; j < 16; j++) {
108 if (pt[j] != temp[j]) {
110 i, j, pt[j], temp[j]);
Memory handling functions.
void av_log_set_level(int level)
Set the log level.
void av_aes_crypt(AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt)
Encrypt or decrypt a buffer using a previously initialized context.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
struct AVAES * av_aes_alloc(void)
Allocate an AVAES context.
int main(int argc, char **argv)
int av_aes_init(AVAES *a, const uint8_t *key, int key_bits, int decrypt)
Initialize an AVAES context.
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)