]> git.sesse.net Git - ffmpeg/commitdiff
xtea: add av_xtea_alloc()
authorJames Almer <jamrial@gmail.com>
Tue, 28 Jul 2015 19:57:48 +0000 (16:57 -0300)
committerAnton Khirnov <anton@khirnov.net>
Fri, 31 Jul 2015 07:04:12 +0000 (09:04 +0200)
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
doc/APIchanges
libavutil/xtea.c
libavutil/xtea.h

index de22fa5dfbda55a63cfbe57e505799540445d2b5..cfab8c6d68bccd6fddffdb38234972ddde74e703 100644 (file)
@@ -16,6 +16,7 @@ API changes, most recent first:
 2015-xx-xx - lavu 54.17.0
   xxxxxxx -  Add av_blowfish_alloc().
   xxxxxxx -  Add av_rc4_alloc().
+  xxxxxxx -  Add av_xtea_alloc().
 
 2015-07-29 - 7e38340 - lavu 54.16.0 - hmac.h
   Add AV_HMAC_SHA224 and AV_HMAC_SHA256.
index 53c0bfe603059a74e0ee64fee0e05e1e982cc5e4..43ba8fcd32c52b6178d3e2721b1a602d7846253e 100644 (file)
 #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;
index 0fc3810dd2ca4c2201cfe7e0bd6f78c9925ea449..4d7c5818d32a452a6c2ab69fc2b5a110f6a43c45 100644 (file)
@@ -22,6 +22,7 @@
 #define AVUTIL_XTEA_H
 
 #include <stdint.h>
+#include "version.h"
 
 /**
  * @file
  * @{
  */
 
+#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.