World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
aes_ctr.h
См. документацию.
1 /*
2  * AES-CTR cipher
3  * Copyright (c) 2015 Eran Kornblau <erankor at gmail dot com>
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #ifndef AVUTIL_AES_CTR_H
23 #define AVUTIL_AES_CTR_H
24 
25 #include <stdint.h>
26 
27 #include "attributes.h"
28 #include "version.h"
29 
30 #define AES_CTR_KEY_SIZE (16)
31 #define AES_CTR_IV_SIZE (8)
32 
33 struct AVAESCTR;
34 
38 struct AVAESCTR *av_aes_ctr_alloc(void);
39 
44 int av_aes_ctr_init(struct AVAESCTR *a, const uint8_t *key);
45 
49 void av_aes_ctr_free(struct AVAESCTR *a);
50 
57 void av_aes_ctr_crypt(struct AVAESCTR *a, uint8_t *dst, const uint8_t *src, int size);
58 
62 const uint8_t* av_aes_ctr_get_iv(struct AVAESCTR *a);
63 
67 void av_aes_ctr_set_random_iv(struct AVAESCTR *a);
68 
72 void av_aes_ctr_set_iv(struct AVAESCTR *a, const uint8_t* iv);
73 
77 void av_aes_ctr_set_full_iv(struct AVAESCTR *a, const uint8_t* iv);
78 
82 void av_aes_ctr_increment_iv(struct AVAESCTR *a);
83 
88 #endif /* AVUTIL_AES_CTR_H */
av_aes_ctr_crypt
void av_aes_ctr_crypt(struct AVAESCTR *a, uint8_t *dst, const uint8_t *src, int size)
av_aes_ctr_set_iv
void av_aes_ctr_set_iv(struct AVAESCTR *a, const uint8_t *iv)
av_aes_ctr_set_full_iv
void av_aes_ctr_set_full_iv(struct AVAESCTR *a, const uint8_t *iv)
av_aes_ctr_get_iv
const uint8_t * av_aes_ctr_get_iv(struct AVAESCTR *a)
src
GLenum src
Definition: SDL_opengl_glext.h:1740
av_aes_ctr_init
int av_aes_ctr_init(struct AVAESCTR *a, const uint8_t *key)
av_aes_ctr_increment_iv
void av_aes_ctr_increment_iv(struct AVAESCTR *a)
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1740
attributes.h
uint8_t
unsigned __int8 uint8_t
Definition: SDL_config.h:35
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1112
av_aes_ctr_alloc
struct AVAESCTR * av_aes_ctr_alloc(void)
size
GLsizeiptr size
Definition: SDL_opengl_glext.h:540
av_aes_ctr_free
void av_aes_ctr_free(struct AVAESCTR *a)
av_aes_ctr_set_random_iv
void av_aes_ctr_set_random_iv(struct AVAESCTR *a)