Path: blob/master/dep/ffmpeg/include/libavutil/camellia.h
4216 views
/*1* An implementation of the CAMELLIA algorithm as mentioned in RFC37132* Copyright (c) 2014 Supraja Meedinti3*4* This file is part of FFmpeg.5*6* FFmpeg is free software; you can redistribute it and/or7* modify it under the terms of the GNU Lesser General Public8* License as published by the Free Software Foundation; either9* version 2.1 of the License, or (at your option) any later version.10*11* FFmpeg is distributed in the hope that it will be useful,12* but WITHOUT ANY WARRANTY; without even the implied warranty of13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU14* Lesser General Public License for more details.15*16* You should have received a copy of the GNU Lesser General Public17* License along with FFmpeg; if not, write to the Free Software18* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA19*/2021#ifndef AVUTIL_CAMELLIA_H22#define AVUTIL_CAMELLIA_H2324#include <stdint.h>252627/**28* @file29* @brief Public header for libavutil CAMELLIA algorithm30* @defgroup lavu_camellia CAMELLIA31* @ingroup lavu_crypto32* @{33*/3435extern const int av_camellia_size;3637struct AVCAMELLIA;3839/**40* Allocate an AVCAMELLIA context41* To free the struct: av_free(ptr)42*/43struct AVCAMELLIA *av_camellia_alloc(void);4445/**46* Initialize an AVCAMELLIA context.47*48* @param ctx an AVCAMELLIA context49* @param key a key of 16, 24, 32 bytes used for encryption/decryption50* @param key_bits number of keybits: possible are 128, 192, 25651*/52int av_camellia_init(struct AVCAMELLIA *ctx, const uint8_t *key, int key_bits);5354/**55* Encrypt or decrypt a buffer using a previously initialized context56*57* @param ctx an AVCAMELLIA context58* @param dst destination array, can be equal to src59* @param src source array, can be equal to dst60* @param count number of 16 byte blocks61* @param iv initialization vector for CBC mode, NULL for ECB mode62* @param decrypt 0 for encryption, 1 for decryption63*/64void av_camellia_crypt(struct AVCAMELLIA *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt);6566/**67* @}68*/69#endif /* AVUTIL_CAMELLIA_H */707172