|
|
|
@ -44,6 +44,7 @@
|
|
|
|
|
#include <uuid/uuid.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include <sodium.h>
|
|
|
|
|
|
|
|
|
|
#include <openssl/ssl.h>
|
|
|
|
|
#include <openssl/err.h>
|
|
|
|
@ -68,6 +69,8 @@ int sxt_init(void)
|
|
|
|
|
|
|
|
|
|
OpenSSL_add_all_algorithms();
|
|
|
|
|
|
|
|
|
|
if(sodium_init() == -1) return SXT_ERROR;
|
|
|
|
|
|
|
|
|
|
return lcrypt_init_ciphers();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -85,14 +88,7 @@ int sxt_reseed(void)
|
|
|
|
|
|
|
|
|
|
int sxt_get_random(void *data, int len, int pseudo)
|
|
|
|
|
{
|
|
|
|
|
if(pseudo) return RAND_bytes(data, len);
|
|
|
|
|
else {
|
|
|
|
|
#if OPENSSL_API_COMPAT < 0x10100000L
|
|
|
|
|
RAND_pseudo_bytes(data, len);
|
|
|
|
|
#else
|
|
|
|
|
RAND_bytes(data, len);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
randombytes_buf(data, (size_t) len);
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|