Commit 5d8bea3b authored by James Almer's avatar James Almer Committed by Anton Khirnov

xtea: add av_xtea_alloc()

Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
parent b469832d
...@@ -16,6 +16,7 @@ API changes, most recent first: ...@@ -16,6 +16,7 @@ API changes, most recent first:
2015-xx-xx - lavu 54.17.0 2015-xx-xx - lavu 54.17.0
xxxxxxx - Add av_blowfish_alloc(). xxxxxxx - Add av_blowfish_alloc().
xxxxxxx - Add av_rc4_alloc(). xxxxxxx - Add av_rc4_alloc().
xxxxxxx - Add av_xtea_alloc().
2015-07-29 - 7e38340 - lavu 54.16.0 - hmac.h 2015-07-29 - 7e38340 - lavu 54.16.0 - hmac.h
Add AV_HMAC_SHA224 and AV_HMAC_SHA256. Add AV_HMAC_SHA224 and AV_HMAC_SHA256.
......
...@@ -31,8 +31,20 @@ ...@@ -31,8 +31,20 @@
#include "avutil.h" #include "avutil.h"
#include "common.h" #include "common.h"
#include "intreadwrite.h" #include "intreadwrite.h"
#include "mem.h"
#include "xtea.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]) void av_xtea_init(AVXTEA *ctx, const uint8_t key[16])
{ {
int i; int i;
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#define AVUTIL_XTEA_H #define AVUTIL_XTEA_H
#include <stdint.h> #include <stdint.h>
#include "version.h"
/** /**
* @file * @file
...@@ -31,9 +32,18 @@ ...@@ -31,9 +32,18 @@
* @{ * @{
*/ */
#if FF_API_CRYPTO_CONTEXT
typedef struct AVXTEA { typedef struct AVXTEA {
uint32_t key[16]; uint32_t key[16];
} AVXTEA; } AVXTEA;
#else
typedef struct AVXTEA AVXTEA;
#endif
/**
* Allocate an AVXTEA context.
*/
AVXTEA *av_xtea_alloc(void);
/** /**
* Initialize an AVXTEA context. * Initialize an AVXTEA context.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment