aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/des.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-08-02 10:41:16 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2015-08-02 10:41:16 +0200
commit3cf08e96fc85ec59b9da2dc79dc1eefc67f5c72d (patch)
tree24a53de6e365472dd8758444d8139b68070b0677 /libavutil/des.c
parent9ca19971bcdd1af39680c15a0319d57505b9542b (diff)
parentd9e8b47e3144262d6bc4681740411d4bdafad6ac (diff)
downloadffmpeg-3cf08e96fc85ec59b9da2dc79dc1eefc67f5c72d.tar.gz
Merge commit 'd9e8b47e3144262d6bc4681740411d4bdafad6ac'
* commit 'd9e8b47e3144262d6bc4681740411d4bdafad6ac': des: add av_des_alloc() Conflicts: libavutil/des.c Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavutil/des.c')
-rw-r--r--libavutil/des.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libavutil/des.c b/libavutil/des.c
index 57ad0a4fff..e7e9178078 100644
--- a/libavutil/des.c
+++ b/libavutil/des.c
@@ -22,9 +22,15 @@
#include "avutil.h"
#include "common.h"
#include "intreadwrite.h"
+#include "mem.h"
#include "des.h"
-typedef struct AVDES AVDES;
+#if !FF_API_CRYPTO_CONTEXT
+struct AVDES {
+ uint64_t round_keys[3][16];
+ int triple_des;
+};
+#endif
#define T(a, b, c, d, e, f, g, h) 64-a,64-b,64-c,64-d,64-e,64-f,64-g,64-h
static const uint8_t IP_shuffle[] = {
@@ -286,6 +292,11 @@ static uint64_t des_encdec(uint64_t in, uint64_t K[16], int decrypt) {
return in;
}
+AVDES *av_des_alloc(void)
+{
+ return av_mallocz(sizeof(struct AVDES));
+}
+
int av_des_init(AVDES *d, const uint8_t *key, int key_bits, av_unused int decrypt) {
if (key_bits != 64 && key_bits != 192)
return -1;