2015-10-12 05:12:16 +02:00
|
|
|
/*
|
2021-01-20 09:02:56 +02:00
|
|
|
* copyright (c) 2015 rcombs
|
2015-10-12 05:12:16 +02:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
|
2020-05-27 14:54:38 +02:00
|
|
|
#include "mem_internal.h"
|
2015-10-12 05:12:16 +02:00
|
|
|
#include <stdint.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).
|
2015-10-12 05:15:08 +02:00
|
|
|
DECLARE_ALIGNED(16, av_aes_block, round_key)[15];
|
|
|
|
DECLARE_ALIGNED(16, av_aes_block, state)[2];
|
2015-10-12 05:12:16 +02:00
|
|
|
int rounds;
|
2015-10-12 05:14:20 +02:00
|
|
|
void (*crypt)(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int rounds);
|
2015-10-12 05:12:16 +02:00
|
|
|
} AVAES;
|
|
|
|
|
|
|
|
#endif /* AVUTIL_AES_INTERNAL_H */
|