/*1* copyright (c) 2007 Michael Niedermayer <[email protected]>2*3* This file is part of FFmpeg.4*5* FFmpeg is free software; you can redistribute it and/or6* modify it under the terms of the GNU Lesser General Public7* License as published by the Free Software Foundation; either8* version 2.1 of the License, or (at your option) any later version.9*10* FFmpeg is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU13* Lesser General Public License for more details.14*15* You should have received a copy of the GNU Lesser General Public16* License along with FFmpeg; if not, write to the Free Software17* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA18*/1920#ifndef AVUTIL_AES_H21#define AVUTIL_AES_H2223#include <stdint.h>2425#include "attributes.h"26#include "version.h"2728/**29* @defgroup lavu_aes AES30* @ingroup lavu_crypto31* @{32*/3334extern const int av_aes_size;3536struct AVAES;3738/**39* Allocate an AVAES context.40*/41struct AVAES *av_aes_alloc(void);4243/**44* Initialize an AVAES context.45* @param key_bits 128, 192 or 25646* @param decrypt 0 for encryption, 1 for decryption47*/48int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt);4950/**51* Encrypt or decrypt a buffer using a previously initialized context.52* @param count number of 16 byte blocks53* @param dst destination array, can be equal to src54* @param src source array, can be equal to dst55* @param iv initialization vector for CBC mode, if NULL then ECB will be used56* @param decrypt 0 for encryption, 1 for decryption57*/58void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);5960/**61* @}62*/6364#endif /* AVUTIL_AES_H */656667