From ec588db56fdc21606a8c8b9b32f4a54aacbe7aca Mon Sep 17 00:00:00 2001 From: Rodger Combs Date: Sun, 11 Oct 2015 22:12:16 -0500 Subject: [PATCH] lavu/aes: move AVAES to separate internal header --- libavutil/aes.c | 16 +--------------- libavutil/aes_internal.h | 41 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 15 deletions(-) create mode 100644 libavutil/aes_internal.h diff --git a/libavutil/aes.c b/libavutil/aes.c index b59e7dec44..61e9dd1b32 100644 --- a/libavutil/aes.c +++ b/libavutil/aes.c @@ -22,24 +22,10 @@ #include "common.h" #include "aes.h" +#include "aes_internal.h" #include "intreadwrite.h" #include "timer.h" -typedef union { - uint64_t u64[2]; - uint32_t u32[4]; - uint8_t u8x4[4][4]; - uint8_t u8[16]; -} av_aes_block; - -typedef struct AVAES { - // Note: round_key[16] is accessed in the init code, but this only - // overwrites state, which does not matter (see also commit ba554c0). - av_aes_block round_key[15]; - av_aes_block state[2]; - int rounds; -} AVAES; - const int av_aes_size= sizeof(AVAES); struct AVAES *av_aes_alloc(void) diff --git a/libavutil/aes_internal.h b/libavutil/aes_internal.h new file mode 100644 index 0000000000..e2841efc1a --- /dev/null +++ b/libavutil/aes_internal.h @@ -0,0 +1,41 @@ +/* + * copyright (c) 2015 Rodger Combs + * + * 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 + */ + +#ifndef AVUTIL_AES_INTERNAL_H +#define AVUTIL_AES_INTERNAL_H + +#include + +typedef union { + uint64_t u64[2]; + uint32_t u32[4]; + uint8_t u8x4[4][4]; + uint8_t u8[16]; +} av_aes_block; + +typedef struct AVAES { + // Note: round_key[16] is accessed in the init code, but this only + // overwrites state, which does not matter (see also commit ba554c0). + av_aes_block round_key[15]; + av_aes_block state[2]; + int rounds; +} AVAES; + +#endif /* AVUTIL_AES_INTERNAL_H */