History

Merge commit 'd9e8b47e3144262d6bc4681740411d4bdafad6ac'

* commit 'd9e8b47e3144262d6bc4681740411d4bdafad6ac': des: add av_des_alloc() Conflicts: libavutil/des.c

Hendrik Leppkes committed 11 years ago

Commit 3cf08e92 parents 9ca1997 d9e8b473 files · +34 −3Browse files

Unified · Split

3 files
  1. doc/APIchanges +1 −0
  2. libavutil/des.c +12 −1
  3. libavutil/des.h +21 −2
doc/APIchanges+1−0
@@ -19,6 +19,7 @@ API changes, most recent first: · 18 unmodified lines
1919 xxxxxxx - Add av_blowfish_alloc().
2020 xxxxxxx - Add av_rc4_alloc().
2121 xxxxxxx - Add av_xtea_alloc().
22+ xxxxxxx - Add av_des_alloc().
2223
2324 2015-xx-xx - lavc 56.35.0 - avcodec.h
2425 xxxxxxxxx - Rename CODEC_FLAG* defines to AV_CODEC_FLAG*.
libavutil/des.c+12−1
@@ -22,9 +22,15 @@ · 21 unmodified lines
2222 #include "avutil.h"
2323 #include "common.h"
2424 #include "intreadwrite.h"
25+#include "mem.h"
2526 #include "des.h"
2627
27−typedef struct AVDES AVDES;
28+#if !FF_API_CRYPTO_CONTEXT
29+struct AVDES {
30+ uint64_t round_keys[3][16];
31+ int triple_des;
32+};
33+#endif
2834
2935 #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
3036 static const uint8_t IP_shuffle[] = {
@@ -286,6 +292,11 @@ static uint64_t des_encdec(uint64_t in, uint64_t K[16], int decrypt) { · 255 unmodified lines
286292 return in;
287293 }
288294
295+AVDES *av_des_alloc(void)
296+{
297+ return av_mallocz(sizeof(struct AVDES));
298+}
299+
289300 int av_des_init(AVDES *d, const uint8_t *key, int key_bits, av_unused int decrypt) {
290301 if (key_bits != 64 && key_bits != 192)
291302 return -1;
libavutil/des.h+21−2
@@ -24,10 +24,25 @@ · 23 unmodified lines
2424
2525 #include <stdint.h>
2626
27−struct AVDES {
27+/**
28+ * @defgroup lavu_des DES
29+ * @ingroup lavu_crypto
30+ * @{
31+ */
32+
33+#if FF_API_CRYPTO_CONTEXT
34+typedef struct AVDES {
2835 uint64_t round_keys[3][16];
2936 int triple_des;
30−};
37+} AVDES;
38+#else
39+typedef struct AVDES AVDES;
40+#endif
41+
42+/**
43+ * Allocate an AVDES context.
44+ */
45+AVDES *av_des_alloc(void);
3146
3247 /**
3348 * @brief Initializes an AVDES context.
@@ -58,4 +73,8 @@ void av_des_crypt(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count, · 24 unmodified lines
5873 */
5974 void av_des_mac(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count);
6075
76+/**
77+ * @}
78+ */
79+
6180 #endif /* AVUTIL_DES_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t