Path: blob/master/dep/ffmpeg/include/libavutil/aes.h
4216 views
/*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"2627/**28* @defgroup lavu_aes AES29* @ingroup lavu_crypto30* @{31*/3233extern const int av_aes_size;3435struct AVAES;3637/**38* Allocate an AVAES context.39*/40struct AVAES *av_aes_alloc(void);4142/**43* Initialize an AVAES context.44*45* @param a The AVAES context46* @param key Pointer to the key47* @param key_bits 128, 192 or 25648* @param decrypt 0 for encryption, 1 for decryption49*/50int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt);5152/**53* Encrypt or decrypt a buffer using a previously initialized context.54*55* @param a The AVAES context56* @param dst destination array, can be equal to src57* @param src source array, can be equal to dst58* @param count number of 16 byte blocks59* @param iv initialization vector for CBC mode, if NULL then ECB will be used60* @param decrypt 0 for encryption, 1 for decryption61*/62void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);6364/**65* @}66*/6768#endif /* AVUTIL_AES_H */697071