Link with libsodium and replace a CSPRNG.

This commit is contained in:
Taylor Hornby
2016-03-17 16:37:55 -06:00
parent abbab2cc4f
commit 41d4eb705b
2 changed files with 4 additions and 4 deletions

View File

@@ -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) {