FFmpeg
aes_init.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Rodger Combs <rodger.combs@gmail.com>
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #include <stddef.h>
22 #include "libavutil/aes_internal.h"
23 #include "libavutil/x86/cpu.h"
24 
25 void ff_aes_decrypt_10_aesni(AVAES *a, uint8_t *dst, const uint8_t *src,
26  int count, uint8_t *iv, int rounds);
27 void ff_aes_decrypt_12_aesni(AVAES *a, uint8_t *dst, const uint8_t *src,
28  int count, uint8_t *iv, int rounds);
29 void ff_aes_decrypt_14_aesni(AVAES *a, uint8_t *dst, const uint8_t *src,
30  int count, uint8_t *iv, int rounds);
31 void ff_aes_encrypt_10_aesni(AVAES *a, uint8_t *dst, const uint8_t *src,
32  int count, uint8_t *iv, int rounds);
33 void ff_aes_encrypt_12_aesni(AVAES *a, uint8_t *dst, const uint8_t *src,
34  int count, uint8_t *iv, int rounds);
35 void ff_aes_encrypt_14_aesni(AVAES *a, uint8_t *dst, const uint8_t *src,
36  int count, uint8_t *iv, int rounds);
37 
38 void ff_init_aes_x86(AVAES *a, int decrypt)
39 {
41 
43  if (a->rounds == 10)
45  else if (a->rounds == 12)
47  else if (a->rounds == 14)
49  }
50 }
cpu.h
ff_aes_encrypt_12_aesni
void ff_aes_encrypt_12_aesni(AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int rounds)
av_get_cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition: cpu.c:109
cpu_flags
static atomic_int cpu_flags
Definition: cpu.c:56
ff_aes_decrypt_14_aesni
void ff_aes_decrypt_14_aesni(AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int rounds)
EXTERNAL_AESNI
#define EXTERNAL_AESNI(flags)
Definition: cpu.h:81
ff_aes_encrypt_14_aesni
void ff_aes_encrypt_14_aesni(AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int rounds)
ff_init_aes_x86
void ff_init_aes_x86(AVAES *a, int decrypt)
Definition: aes_init.c:38
ff_aes_encrypt_10_aesni
void ff_aes_encrypt_10_aesni(AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int rounds)
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:83
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
aes_internal.h
ff_aes_decrypt_10_aesni
void ff_aes_decrypt_10_aesni(AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int rounds)
ff_aes_decrypt_12_aesni
void ff_aes_decrypt_12_aesni(AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int rounds)
AVAES
Definition: aes_internal.h:34
src
#define src
Definition: vp8dsp.c:248