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++) {
71 v1 -= ((v0 << 4) + k2) ^ (v0 + sum) ^ ((v0 >> 5) + k3);
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);
87 v1 += ((v0 << 4) + k2) ^ (v0 + sum) ^ ((v0 >> 5) + k3);
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)
Convenience header that includes libavutil's core.
struct AVTEA * av_tea_alloc(void)
Allocate an AVTEA context To free the struct: av_free(ptr)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
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.