Commit 9ed59f16 authored by Hendrik Leppkes's avatar Hendrik Leppkes

Merge commit '7a7df34c'

* commit '7a7df34c':
  blowfish: add av_blowfish_alloc()

Conflicts:
	doc/APIchanges
	libavutil/version.h
Merged-by: 's avatarHendrik Leppkes <h.leppkes@gmail.com>
parents 988ddfea 7a7df34c
...@@ -15,6 +15,9 @@ libavutil: 2014-08-09 ...@@ -15,6 +15,9 @@ libavutil: 2014-08-09
API changes, most recent first: API changes, most recent first:
2015-xx-xx - lavu 54.30.0
xxxxxxx - Add av_blowfish_alloc().
2015-xx-xx - lavc 56.35.0 - avcodec.h 2015-xx-xx - lavc 56.35.0 - avcodec.h
xxxxxxxxx - Rename CODEC_FLAG* defines to AV_CODEC_FLAG*. xxxxxxxxx - Rename CODEC_FLAG* defines to AV_CODEC_FLAG*.
xxxxxxxxx - Rename CODEC_CAP_* defines to AV_CODEC_CAP_*. xxxxxxxxx - Rename CODEC_CAP_* defines to AV_CODEC_CAP_*.
......
...@@ -24,8 +24,18 @@ ...@@ -24,8 +24,18 @@
#include "avutil.h" #include "avutil.h"
#include "common.h" #include "common.h"
#include "intreadwrite.h" #include "intreadwrite.h"
#include "mem.h"
#include "blowfish.h" #include "blowfish.h"
#if !FF_API_CRYPTO_CONTEXT
#define AV_BF_ROUNDS 16
struct AVBlowfish {
uint32_t p[AV_BF_ROUNDS + 2];
uint32_t s[4][256];
};
#endif
static const uint32_t orig_p[AV_BF_ROUNDS + 2] = { static const uint32_t orig_p[AV_BF_ROUNDS + 2] = {
0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, 0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344,
0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89, 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89,
...@@ -300,6 +310,11 @@ static const uint32_t orig_s[4][256] = { ...@@ -300,6 +310,11 @@ static const uint32_t orig_s[4][256] = {
+ ctx->s[3][ Xl & 0xFF])\ + ctx->s[3][ Xl & 0xFF])\
^ P; ^ P;
AVBlowfish *av_blowfish_alloc(void)
{
return av_mallocz(sizeof(struct AVBlowfish));
}
av_cold void av_blowfish_init(AVBlowfish *ctx, const uint8_t *key, int key_len) av_cold void av_blowfish_init(AVBlowfish *ctx, const uint8_t *key, int key_len)
{ {
uint32_t data, data_l, data_r; uint32_t data, data_l, data_r;
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#define AVUTIL_BLOWFISH_H #define AVUTIL_BLOWFISH_H
#include <stdint.h> #include <stdint.h>
#include "version.h"
/** /**
* @defgroup lavu_blowfish Blowfish * @defgroup lavu_blowfish Blowfish
...@@ -30,12 +31,21 @@ ...@@ -30,12 +31,21 @@
* @{ * @{
*/ */
#if FF_API_CRYPTO_CONTEXT
#define AV_BF_ROUNDS 16 #define AV_BF_ROUNDS 16
typedef struct AVBlowfish { typedef struct AVBlowfish {
uint32_t p[AV_BF_ROUNDS + 2]; uint32_t p[AV_BF_ROUNDS + 2];
uint32_t s[4][256]; uint32_t s[4][256];
} AVBlowfish; } AVBlowfish;
#else
typedef struct AVBlowfish AVBlowfish;
#endif
/**
* Allocate an AVBlowfish context.
*/
AVBlowfish *av_blowfish_alloc(void);
/** /**
* Initialize an AVBlowfish context. * Initialize an AVBlowfish context.
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
*/ */
#define LIBAVUTIL_VERSION_MAJOR 54 #define LIBAVUTIL_VERSION_MAJOR 54
#define LIBAVUTIL_VERSION_MINOR 29 #define LIBAVUTIL_VERSION_MINOR 30
#define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
...@@ -125,6 +125,9 @@ ...@@ -125,6 +125,9 @@
#ifndef FF_API_HMAC #ifndef FF_API_HMAC
#define FF_API_HMAC (LIBAVUTIL_VERSION_MAJOR < 55) #define FF_API_HMAC (LIBAVUTIL_VERSION_MAJOR < 55)
#endif #endif
#ifndef FF_API_CRYPTO_CONTEXT
#define FF_API_CRYPTO_CONTEXT (LIBAVUTIL_VERSION_MAJOR < 56)
#endif
#ifndef FF_CONST_AVUTIL55 #ifndef FF_CONST_AVUTIL55
#if LIBAVUTIL_VERSION_MAJOR >= 55 #if LIBAVUTIL_VERSION_MAJOR >= 55
......
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