FFmpeg
Macros | Functions | Variables
xtea.c File Reference
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "libavutil/xtea.h"

Go to the source code of this file.

Macros

#define XTEA_NUM_TESTS   6
 

Functions

static void test_xtea (AVXTEA *ctx, uint8_t *dst, const uint8_t *src, const uint8_t *ref, int len, uint8_t *iv, int dir, const char *test, void(*crypt)(AVXTEA *, uint8_t *, const uint8_t *, int, uint8_t *, int))
 
int main (void)
 

Variables

static const uint8_t xtea_test_key [XTEA_NUM_TESTS][16]
 
static const uint8_t xtea_test_pt [XTEA_NUM_TESTS][8]
 
static const uint8_t xtea_test_ct [XTEA_NUM_TESTS][8]
 

Macro Definition Documentation

◆ XTEA_NUM_TESTS

#define XTEA_NUM_TESTS   6

Definition at line 28 of file xtea.c.

Function Documentation

◆ test_xtea()

static void test_xtea ( AVXTEA ctx,
uint8_t *  dst,
const uint8_t *  src,
const uint8_t *  ref,
int  len,
uint8_t *  iv,
int  dir,
const char *  test,
void(*)(AVXTEA *, uint8_t *, const uint8_t *, int, uint8_t *, int)  crypt 
)
static

Definition at line 63 of file xtea.c.

Referenced by main().

◆ main()

int main ( void  )

Definition at line 82 of file xtea.c.

Variable Documentation

◆ xtea_test_key

const uint8_t xtea_test_key[XTEA_NUM_TESTS][16]
static
Initial value:
= {
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
}

Definition at line 30 of file xtea.c.

Referenced by main().

◆ xtea_test_pt

const uint8_t xtea_test_pt[XTEA_NUM_TESTS][8]
static
Initial value:
= {
{ 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48 },
{ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 },
{ 0x5a, 0x5b, 0x6e, 0x27, 0x89, 0x48, 0xd7, 0x7f },
{ 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48 },
{ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 },
{ 0x70, 0xe1, 0x22, 0x5d, 0x6e, 0x4e, 0x76, 0x55 }
}

Definition at line 45 of file xtea.c.

Referenced by main().

◆ xtea_test_ct

const uint8_t xtea_test_ct[XTEA_NUM_TESTS][8]
static
Initial value:
= {
{ 0x49, 0x7d, 0xf3, 0xd0, 0x72, 0x61, 0x2c, 0xb5 },
{ 0xe7, 0x8f, 0x2d, 0x13, 0x74, 0x43, 0x41, 0xd8 },
{ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 },
{ 0xa0, 0x39, 0x05, 0x89, 0xf8, 0xb8, 0xef, 0xa5 },
{ 0xed, 0x23, 0x37, 0x5a, 0x82, 0x1a, 0x8c, 0x2d },
{ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 }
}

Definition at line 54 of file xtea.c.

Referenced by main().