Unified · Split
| @@ -13,6 +13,9 @@ libavutil: 2014-08-09 · 12 unmodified lines | |||
| 13 | 13 | ||
| 14 | API changes, most recent first: | 14 | API changes, most recent first: |
| 15 | 15 | ||
| 16 | 2015-xx-xx - lavu 54.17.0 | ||
| 17 | xxxxxxx - Add av_blowfish_alloc(). | ||
| 18 | |||
| 16 | 2015-07-29 - 7e38340 - lavu 54.16.0 - hmac.h | 19 | 2015-07-29 - 7e38340 - lavu 54.16.0 - hmac.h |
| 17 | Add AV_HMAC_SHA224 and AV_HMAC_SHA256. | 20 | Add AV_HMAC_SHA224 and AV_HMAC_SHA256. |
| 18 | 21 | ||
| @@ -24,8 +24,18 @@ · 23 unmodified lines | |||
| 24 | #include "avutil.h" | 24 | #include "avutil.h" |
| 25 | #include "common.h" | 25 | #include "common.h" |
| 26 | #include "intreadwrite.h" | 26 | #include "intreadwrite.h" |
| 27 | #include "mem.h" | ||
| 27 | #include "blowfish.h" | 28 | #include "blowfish.h" |
| 28 | 29 | ||
| 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 | |||
| 29 | static const uint32_t orig_p[AV_BF_ROUNDS + 2] = { | 39 | static const uint32_t orig_p[AV_BF_ROUNDS + 2] = { |
| 30 | 0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, | 40 | 0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, |
| 31 | 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89, | 41 | 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89, |
| @@ -312,6 +322,11 @@ static void F(AVBlowfish *ctx, uint32_t *xl, uint32_t *xr, int i) · 280 unmodified lines | |||
| 312 | *xr = Xl; | 322 | *xr = Xl; |
| 313 | } | 323 | } |
| 314 | 324 | ||
| 325 | AVBlowfish *av_blowfish_alloc(void) | ||
| 326 | { | ||
| 327 | return av_mallocz(sizeof(struct AVBlowfish)); | ||
| 328 | } | ||
| 329 | |||
| 315 | av_cold void av_blowfish_init(AVBlowfish *ctx, const uint8_t *key, int key_len) | 330 | av_cold void av_blowfish_init(AVBlowfish *ctx, const uint8_t *key, int key_len) |
| 316 | { | 331 | { |
| 317 | uint32_t data, data_l, data_r; | 332 | uint32_t data, data_l, data_r; |
| @@ -22,6 +22,7 @@ · 21 unmodified lines | |||
| 22 | #define AVUTIL_BLOWFISH_H | 22 | #define AVUTIL_BLOWFISH_H |
| 23 | 23 | ||
| 24 | #include <stdint.h> | 24 | #include <stdint.h> |
| 25 | #include "version.h" | ||
| 25 | 26 | ||
| 26 | /** | 27 | /** |
| 27 | * @defgroup lavu_blowfish Blowfish | 28 | * @defgroup lavu_blowfish Blowfish |
| @@ -29,12 +30,21 @@ · 1 unmodified line | |||
| 29 | * @{ | 30 | * @{ |
| 30 | */ | 31 | */ |
| 31 | 32 | ||
| 33 | #if FF_API_CRYPTO_CONTEXT | ||
| 32 | #define AV_BF_ROUNDS 16 | 34 | #define AV_BF_ROUNDS 16 |
| 33 | 35 | ||
| 34 | typedef struct AVBlowfish { | 36 | typedef struct AVBlowfish { |
| 35 | uint32_t p[AV_BF_ROUNDS + 2]; | 37 | uint32_t p[AV_BF_ROUNDS + 2]; |
| 36 | uint32_t s[4][256]; | 38 | uint32_t s[4][256]; |
| 37 | } AVBlowfish; | 39 | } AVBlowfish; |
| 40 | #else | ||
| 41 | typedef struct AVBlowfish AVBlowfish; | ||
| 42 | #endif | ||
| 43 | |||
| 44 | /** | ||
| 45 | * Allocate an AVBlowfish context. | ||
| 46 | */ | ||
| 47 | AVBlowfish *av_blowfish_alloc(void); | ||
| 38 | 48 | ||
| 39 | /** | 49 | /** |
| 40 | * Initialize an AVBlowfish context. | 50 | * Initialize an AVBlowfish context. |
| @@ -54,7 +54,7 @@ · 53 unmodified lines | |||
| 54 | */ | 54 | */ |
| 55 | 55 | ||
| 56 | #define LIBAVUTIL_VERSION_MAJOR 54 | 56 | #define LIBAVUTIL_VERSION_MAJOR 54 |
| 57 | #define LIBAVUTIL_VERSION_MINOR 16 | 57 | #define LIBAVUTIL_VERSION_MINOR 17 |
| 58 | #define LIBAVUTIL_VERSION_MICRO 0 | 58 | #define LIBAVUTIL_VERSION_MICRO 0 |
| 59 | 59 | ||
| 60 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ | 60 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |
| @@ -114,6 +114,9 @@ · 53 unmodified lines | |||
| 114 | #ifndef FF_API_DLOG | 114 | #ifndef FF_API_DLOG |
| 115 | #define FF_API_DLOG (LIBAVUTIL_VERSION_MAJOR < 55) | 115 | #define FF_API_DLOG (LIBAVUTIL_VERSION_MAJOR < 55) |
| 116 | #endif | 116 | #endif |
| 117 | #ifndef FF_API_CRYPTO_CONTEXT | ||
| 118 | #define FF_API_CRYPTO_CONTEXT (LIBAVUTIL_VERSION_MAJOR < 56) | ||
| 119 | #endif | ||
| 117 | 120 | ||
| 118 | 121 | ||
| 119 | /** | 122 | /** |