annotate lib/libavutil/aes.h @ 2134:992d2e6f907d

preparation for libavcodec
author zipi
date Tue, 31 Dec 2013 14:52:14 +0000
parents
children
rev   line source
2134
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2 * copyright (c) 2007 Michael Niedermayer <michaelni@gmx.at>
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4 * This file is part of FFmpeg.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
5 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
6 * FFmpeg is free software; you can redistribute it and/or
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
10 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
11 * FFmpeg is distributed in the hope that it will be useful,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
14 * Lesser General Public License for more details.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
15 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
17 * License along with FFmpeg; if not, write to the Free Software
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
19 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
20
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
21 #ifndef AVUTIL_AES_H
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
22 #define AVUTIL_AES_H
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
23
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
24 #include <stdint.h>
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
25
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
26 #include "attributes.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
27 #include "version.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
28
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
29 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
30 * @defgroup lavu_aes AES
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
31 * @ingroup lavu_crypto
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
32 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
33 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
34
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
35 extern const int av_aes_size;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
36
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
37 struct AVAES;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
38
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
39 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
40 * Allocate an AVAES context.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
41 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
42 struct AVAES *av_aes_alloc(void);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
43
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
44 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
45 * Initialize an AVAES context.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
46 * @param key_bits 128, 192 or 256
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
47 * @param decrypt 0 for encryption, 1 for decryption
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
48 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
49 int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
50
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
51 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
52 * Encrypt or decrypt a buffer using a previously initialized context.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
53 * @param count number of 16 byte blocks
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
54 * @param dst destination array, can be equal to src
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
55 * @param src source array, can be equal to dst
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
56 * @param iv initialization vector for CBC mode, if NULL then ECB will be used
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
57 * @param decrypt 0 for encryption, 1 for decryption
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
58 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
59 void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
60
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
61 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
62 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
63 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
64
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
65 #endif /* AVUTIL_AES_H */