History

Merge commit '7a7df34c91e16ea8936f59524145a2cdd6b790f9'

* commit '7a7df34c91e16ea8936f59524145a2cdd6b790f9': blowfish: add av_blowfish_alloc() Conflicts: doc/APIchanges libavutil/version.h

Hendrik Leppkes committed 11 years ago

Commit 9ed59f12 parents 988ddfe 7a7df344 files · +32 −1Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavutil/blowfish.c +15 −0
  3. libavutil/blowfish.h +10 −0
  4. libavutil/version.h +4 −1
doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2014-08-09 · 14 unmodified lines
1515
1616 API changes, most recent first:
1717
18+2015-xx-xx - lavu 54.30.0
19+ xxxxxxx - Add av_blowfish_alloc().
20+
1821 2015-xx-xx - lavc 56.35.0 - avcodec.h
1922 xxxxxxxxx - Rename CODEC_FLAG* defines to AV_CODEC_FLAG*.
2023 xxxxxxxxx - Rename CODEC_CAP_* defines to AV_CODEC_CAP_*.
libavutil/blowfish.c+15−0
@@ -24,8 +24,18 @@ · 23 unmodified lines
2424 #include "avutil.h"
2525 #include "common.h"
2626 #include "intreadwrite.h"
27+#include "mem.h"
2728 #include "blowfish.h"
2829
30+#if !FF_API_CRYPTO_CONTEXT
31+#define AV_BF_ROUNDS 16
32+
33+struct AVBlowfish {
34+ uint32_t p[AV_BF_ROUNDS + 2];
35+ uint32_t s[4][256];
36+};
37+#endif
38+
2939 static const uint32_t orig_p[AV_BF_ROUNDS + 2] = {
3040 0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344,
3141 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89,
@@ -300,6 +310,11 @@ static const uint32_t orig_s[4][256] = { · 268 unmodified lines
300310 + ctx->s[3][ Xl & 0xFF])\
301311 ^ P;
302312
313+AVBlowfish *av_blowfish_alloc(void)
314+{
315+ return av_mallocz(sizeof(struct AVBlowfish));
316+}
317+
303318 av_cold void av_blowfish_init(AVBlowfish *ctx, const uint8_t *key, int key_len)
304319 {
305320 uint32_t data, data_l, data_r;
libavutil/blowfish.h+10−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #define AVUTIL_BLOWFISH_H
2424
2525 #include <stdint.h>
26+#include "version.h"
2627
2728 /**
2829 * @defgroup lavu_blowfish Blowfish
@@ -30,12 +31,21 @@ · 1 unmodified line
3031 * @{
3132 */
3233
34+#if FF_API_CRYPTO_CONTEXT
3335 #define AV_BF_ROUNDS 16
3436
3537 typedef struct AVBlowfish {
3638 uint32_t p[AV_BF_ROUNDS + 2];
3739 uint32_t s[4][256];
3840 } AVBlowfish;
41+#else
42+typedef struct AVBlowfish AVBlowfish;
43+#endif
44+
45+/**
46+ * Allocate an AVBlowfish context.
47+ */
48+AVBlowfish *av_blowfish_alloc(void);
3949
4050 /**
4151 * Initialize an AVBlowfish context.
libavutil/version.h+4−1
@@ -56,7 +56,7 @@ · 55 unmodified lines
5656 */
5757
5858 #define LIBAVUTIL_VERSION_MAJOR 54
59−#define LIBAVUTIL_VERSION_MINOR 29
59+#define LIBAVUTIL_VERSION_MINOR 30
6060 #define LIBAVUTIL_VERSION_MICRO 100
6161
6262 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
@@ -125,6 +125,9 @@ · 62 unmodified lines
125125 #ifndef FF_API_HMAC
126126 #define FF_API_HMAC (LIBAVUTIL_VERSION_MAJOR < 55)
127127 #endif
128+#ifndef FF_API_CRYPTO_CONTEXT
129+#define FF_API_CRYPTO_CONTEXT (LIBAVUTIL_VERSION_MAJOR < 56)
130+#endif
128131
129132 #ifndef FF_CONST_AVUTIL55
130133 #if LIBAVUTIL_VERSION_MAJOR >= 55

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