46 for (i = 0; i < 4; i++)
57 uint32_t k0, k1, k2, k3;
68 uint32_t
delta = 0x9E3779B9
U, sum = delta * (rounds / 2);
70 for (i = 0; i < rounds / 2; i++) {
72 v0 -= ((v1 << 4) + k0) ^ (v1 + sum) ^ ((v1 >> 5) + k1);
82 uint32_t sum = 0,
delta = 0x9E3779B9
U;
84 for (i = 0; i < rounds / 2; i++) {
86 v0 += ((v1 << 4) + k0) ^ (v1 + sum) ^ ((v1 >> 5) + k1);
110 for (i = 0; i < 8; i++)
111 dst[i] = src[i] ^ iv[i];
static void tea_crypt_ecb(AVTEA *ctx, uint8_t *dst, const uint8_t *src, int decrypt, uint8_t *iv)
struct AVTEA * av_tea_alloc(void)
Allocate an AVTEA context To free the struct: av_free(ptr)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
Public header for libavutil TEA algorithm.
void av_tea_crypt(AVTEA *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt)
Encrypt or decrypt a buffer using a previously initialized context.
common internal and external API header
void av_tea_init(AVTEA *ctx, const uint8_t key[16], int rounds)
Initialize an AVTEA context.
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...