/* * A 32-bit implementation of the TEA algorithm * Copyright (c) 2015 Vesselin Bontchev * * Loosely based on the implementation of David Wheeler and Roger Needham, * https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm#Reference_code * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <string.h> #include "intreadwrite.h" #include "mem.h" #include "tea.h" AVTEA; struct AVTEA *av_tea_alloc(void) { … } const int av_tea_size = …; void av_tea_init(AVTEA *ctx, const uint8_t key[16], int rounds) { … } static void tea_crypt_ecb(AVTEA *ctx, uint8_t *dst, const uint8_t *src, int decrypt, uint8_t *iv) { … } void av_tea_crypt(AVTEA *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt) { … }