Commit 589d39c7 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '63ce9fd2'

* commit '63ce9fd2':
  rtmpdh: Use GMP functions directly, instead of nettle wrappers
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 8939667b 63ce9fd2
...@@ -1895,6 +1895,7 @@ CONFIG_EXTRA=" ...@@ -1895,6 +1895,7 @@ CONFIG_EXTRA="
fmtconvert fmtconvert
frame_thread_encoder frame_thread_encoder
gcrypt gcrypt
gmp
golomb golomb
gplv3 gplv3
h263dsp h263dsp
...@@ -1921,7 +1922,6 @@ CONFIG_EXTRA=" ...@@ -1921,7 +1922,6 @@ CONFIG_EXTRA="
mpegaudiodsp mpegaudiodsp
mpegvideo mpegvideo
mpegvideoenc mpegvideoenc
nettle
pixblockdsp pixblockdsp
qpeldsp qpeldsp
qsv qsv
...@@ -2617,7 +2617,7 @@ x11grab_xcb_indev_deps="libxcb" ...@@ -2617,7 +2617,7 @@ x11grab_xcb_indev_deps="libxcb"
# protocols # protocols
bluray_protocol_deps="libbluray" bluray_protocol_deps="libbluray"
ffrtmpcrypt_protocol_deps="!librtmp_protocol" ffrtmpcrypt_protocol_deps="!librtmp_protocol"
ffrtmpcrypt_protocol_deps_any="gcrypt nettle openssl" ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl"
ffrtmpcrypt_protocol_select="tcp_protocol" ffrtmpcrypt_protocol_select="tcp_protocol"
ffrtmphttp_protocol_deps="!librtmp_protocol" ffrtmphttp_protocol_deps="!librtmp_protocol"
ffrtmphttp_protocol_select="http_protocol" ffrtmphttp_protocol_select="http_protocol"
...@@ -5204,7 +5204,7 @@ enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -l ...@@ -5204,7 +5204,7 @@ enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -l
enabled qtkit_indev && { check_header_oc QTKit/QTKit.h || disable qtkit_indev; } enabled qtkit_indev && { check_header_oc QTKit/QTKit.h || disable qtkit_indev; }
if enabled gnutls; then if enabled gnutls; then
{ check_lib nettle/bignum.h nettle_mpz_get_str_256 -lnettle -lhogweed -lgmp && enable nettle; } || { check_lib2 gmp.h mpz_export -lgmp && enable gmp; } ||
{ check_lib gcrypt.h gcry_mpi_new -lgcrypt && enable gcrypt; } { check_lib gcrypt.h gcry_mpi_new -lgcrypt && enable gcrypt; }
fi fi
......
...@@ -46,8 +46,8 @@ ...@@ -46,8 +46,8 @@
"F71C35FDAD44CFD2D74F9208BE258FF324943328F67329C0" \ "F71C35FDAD44CFD2D74F9208BE258FF324943328F67329C0" \
"FFFFFFFFFFFFFFFF" "FFFFFFFFFFFFFFFF"
#if CONFIG_NETTLE || CONFIG_GCRYPT #if CONFIG_GMP || CONFIG_GCRYPT
#if CONFIG_NETTLE #if CONFIG_GMP
#define bn_new(bn) \ #define bn_new(bn) \
do { \ do { \
bn = av_malloc(sizeof(*bn)); \ bn = av_malloc(sizeof(*bn)); \
...@@ -65,12 +65,17 @@ ...@@ -65,12 +65,17 @@
#define bn_sub_word(bn, w) mpz_sub_ui(bn, bn, w) #define bn_sub_word(bn, w) mpz_sub_ui(bn, bn, w)
#define bn_cmp_1(bn) mpz_cmp_ui(bn, 1) #define bn_cmp_1(bn) mpz_cmp_ui(bn, 1)
#define bn_num_bytes(bn) (mpz_sizeinbase(bn, 2) + 7) / 8 #define bn_num_bytes(bn) (mpz_sizeinbase(bn, 2) + 7) / 8
#define bn_bn2bin(bn, buf, len) nettle_mpz_get_str_256(len, buf, bn) #define bn_bn2bin(bn, buf, len) \
do { \
memset(buf, 0, len); \
if (bn_num_bytes(bn) <= len) \
mpz_export(buf, NULL, 1, 1, 0, 0, bn); \
} while (0)
#define bn_bin2bn(bn, buf, len) \ #define bn_bin2bn(bn, buf, len) \
do { \ do { \
bn_new(bn); \ bn_new(bn); \
if (bn) \ if (bn) \
nettle_mpz_set_str_256_u(bn, len, buf); \ mpz_import(bn, len, 1, 1, 0, 0, buf); \
} while (0) } while (0)
#define bn_hex2bn(bn, buf, ret) \ #define bn_hex2bn(bn, buf, ret) \
do { \ do { \
......
...@@ -25,10 +25,9 @@ ...@@ -25,10 +25,9 @@
#include "avformat.h" #include "avformat.h"
#include "config.h" #include "config.h"
#if CONFIG_NETTLE || CONFIG_GCRYPT #if CONFIG_GMP || CONFIG_GCRYPT
#if CONFIG_NETTLE #if CONFIG_GMP
#include <gmp.h> #include <gmp.h>
#include <nettle/bignum.h>
typedef mpz_ptr FFBigNum; typedef mpz_ptr FFBigNum;
#elif CONFIG_GCRYPT #elif CONFIG_GCRYPT
......
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