aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-08-02 10:39:37 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2015-08-02 10:39:37 +0200
commit9ca19971bcdd1af39680c15a0319d57505b9542b (patch)
treeca8ae1eb4d2175869002090081788b0093dc520b /libavutil
parent52566efd5cf8c40d4e5bf8d54fa3cfdab921baad (diff)
parent5d8bea3bb2357bb304f8f771a4107039037c5549 (diff)
downloadffmpeg-9ca19971bcdd1af39680c15a0319d57505b9542b.tar.gz
Merge commit '5d8bea3bb2357bb304f8f771a4107039037c5549'
* commit '5d8bea3bb2357bb304f8f771a4107039037c5549': xtea: add av_xtea_alloc() Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/xtea.c12
-rw-r--r--libavutil/xtea.h10
2 files changed, 22 insertions, 0 deletions
diff --git a/libavutil/xtea.c b/libavutil/xtea.c
index 1750cbc45a..b95f32239e 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 6f1e71e345..4281fd8c8f 100644
--- a/libavutil/xtea.h
+++ b/libavutil/xtea.h
@@ -23,6 +23,7 @@
#define AVUTIL_XTEA_H
#include <stdint.h>
+#include "version.h"
/**
* @file
@@ -32,9 +33,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.