diff options
author | James Almer <jamrial@gmail.com> | 2015-07-28 16:57:48 -0300 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-07-31 09:04:12 +0200 |
commit | 5d8bea3bb2357bb304f8f771a4107039037c5549 (patch) | |
tree | 3a663eea6e478850b037385255b0070dce5aee56 /libavutil | |
parent | b469832de993dabbfe037bef59c68e90e82ebca5 (diff) | |
download | ffmpeg-5d8bea3bb2357bb304f8f771a4107039037c5549.tar.gz |
xtea: add av_xtea_alloc()
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/xtea.c | 12 | ||||
-rw-r--r-- | libavutil/xtea.h | 10 |
2 files changed, 22 insertions, 0 deletions
diff --git a/libavutil/xtea.c b/libavutil/xtea.c index 53c0bfe603..43ba8fcd32 100644 --- a/libavutil/xtea.c +++ b/libavutil/xtea.c @@ -31,8 +31,20 @@ #include "avutil.h" #include "common.h" #include "intreadwrite.h" +#include "mem.h" #include "xtea.h" +#if !FF_API_CRYPTO_CONTEXT +struct AVXTEA { + uint32_t key[16]; +}; +#endif + +AVXTEA *av_xtea_alloc(void) +{ + return av_mallocz(sizeof(struct AVXTEA)); +} + void av_xtea_init(AVXTEA *ctx, const uint8_t key[16]) { int i; diff --git a/libavutil/xtea.h b/libavutil/xtea.h index 0fc3810dd2..4d7c5818d3 100644 --- a/libavutil/xtea.h +++ b/libavutil/xtea.h @@ -22,6 +22,7 @@ #define AVUTIL_XTEA_H #include <stdint.h> +#include "version.h" /** * @file @@ -31,9 +32,18 @@ * @{ */ +#if FF_API_CRYPTO_CONTEXT typedef struct AVXTEA { uint32_t key[16]; } AVXTEA; +#else +typedef struct AVXTEA AVXTEA; +#endif + +/** + * Allocate an AVXTEA context. + */ +AVXTEA *av_xtea_alloc(void); /** * Initialize an AVXTEA context. |