|
|
@@ -24,8 +24,18 @@ |
|
|
|
#include "avutil.h" |
|
|
|
#include "common.h" |
|
|
|
#include "intreadwrite.h" |
|
|
|
#include "mem.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] = { |
|
|
|
0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, |
|
|
|
0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89, |
|
|
@@ -300,6 +310,11 @@ static const uint32_t orig_s[4][256] = { |
|
|
|
+ ctx->s[3][ Xl & 0xFF])\ |
|
|
|
^ 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) |
|
|
|
{ |
|
|
|
uint32_t data, data_l, data_r; |
|
|
|