Link with libsodium and replace a CSPRNG.
This commit is contained in:
parent
abbab2cc4f
commit
41d4eb705b
|
@ -717,7 +717,7 @@ CPPFLAGS="-I$LIBSNARK_INCDIR $CPPFLAGS"
|
|||
AC_CHECK_HEADER([libsnark/gadgetlib1/gadget.hpp],,AC_MSG_ERROR(libsnark headers missing))
|
||||
AC_CHECK_LIB([snark],[main],LIBSNARK_LIBS=-lsnark, [AC_MSG_ERROR(libsnark missing)], [-lgmpxx])
|
||||
|
||||
LIBZEROCASH_LIBS="-lsnark -lcryptopp -lgmp -lgmpxx -lboost_system-mt -lcrypto"
|
||||
LIBZEROCASH_LIBS="-lsnark -lcryptopp -lgmp -lgmpxx -lboost_system-mt -lcrypto -lsodium"
|
||||
|
||||
AC_CHECK_LIB([crypto],[RAND_egd],[],[
|
||||
AC_ARG_WITH([libressl],
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
#include <iomanip>
|
||||
#include <algorithm>
|
||||
|
||||
#include <sodium.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
namespace libzerocash {
|
||||
|
@ -82,9 +84,7 @@ void printBytesVectorAsHex(const std::string str, const std::vector<unsigned cha
|
|||
}
|
||||
|
||||
void getRandBytes(unsigned char* bytes, int num) {
|
||||
int ret = RAND_bytes(bytes, num);
|
||||
if(ret != 1)
|
||||
std::cout << "rand_bytes error!" << ERR_get_error() << std::endl;
|
||||
randombytes_buf(bytes, num);
|
||||
}
|
||||
|
||||
void convertBytesToVector(const unsigned char* bytes, std::vector<bool>& v) {
|
||||
|
|
Loading…
Reference in New Issue