1 /*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
22
24 0x6d, 0x6f, 0x73, 0x74, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d
25 };
27
29 {
30 int ret = 1;
33
36
37 if (!ae || !ad)
39
42
45
49
52
56 }
57
59 ret = 0;
60
64 return ret;
65 }
Memory handling functions.
void av_aes_ctr_crypt(struct AVAESCTR *a, uint8_t *dst, const uint8_t *src, int count)
Process a buffer using a previously initialized context.
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
static void ERROR(const char *str)
void av_aes_ctr_free(struct AVAESCTR *a)
Release an AVAESCTR context.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static const uint8_t plain[]
struct AVAESCTR * av_aes_ctr_alloc(void)
Allocate an AVAESCTR context.
void av_aes_ctr_set_random_iv(struct AVAESCTR *a)
Generate a random iv.
#define AV_LOG_INFO
Standard information.
int av_aes_ctr_init(struct AVAESCTR *a, const uint8_t *key)
Initialize an AVAESCTR context.
void av_aes_ctr_set_full_iv(struct AVAESCTR *a, const uint8_t *iv)
Forcefully change the "full" 16-byte iv, including the counter.
const uint8_t * av_aes_ctr_get_iv(struct AVAESCTR *a)
Get the current iv.