Remove rand compilation message

This commit is contained in:
ben
2025-11-14 23:04:39 +01:00
parent 69f43babec
commit 7ecdc0bb91

View File

@@ -149,7 +149,7 @@ static int randombytes_linux_wait_for_entropy(int device)
} }
if (entropy >= bits) { if (entropy >= bits) {
break; break;
} }
} else { } else {
// Unreachable: poll() can should only return -1 or 1 // Unreachable: poll() can should only return -1 or 1
retcode_error = -1; retcode_error = -1;
@@ -236,24 +236,24 @@ static int randombytes_js_randombytes_nodejs(void *buf, size_t n) {
int randombytes(void *buf, size_t n) int randombytes(void *buf, size_t n)
{ {
#if defined(__EMSCRIPTEN__) #if defined(__EMSCRIPTEN__)
# pragma message("Using crypto api from NodeJS") //# pragma message("Using crypto api from NodeJS")
return randombytes_js_randombytes_nodejs(buf, n); return randombytes_js_randombytes_nodejs(buf, n);
#elif defined(__linux__) #elif defined(__linux__)
# if defined(SYS_getrandom) # if defined(SYS_getrandom)
# pragma message("Using getrandom system call") //# pragma message("Using getrandom system call")
/* Use getrandom system call */ /* Use getrandom system call */
return randombytes_linux_randombytes_getrandom(buf, n); return randombytes_linux_randombytes_getrandom(buf, n);
# else # else
# pragma message("Using /dev/urandom device") //# pragma message("Using /dev/urandom device")
/* When we have enough entropy, we can read from /dev/urandom */ /* When we have enough entropy, we can read from /dev/urandom */
return randombytes_linux_randombytes_urandom(buf, n); return randombytes_linux_randombytes_urandom(buf, n);
# endif # endif
#elif defined(BSD) #elif defined(BSD)
# pragma message("Using arc4random system call") //# pragma message("Using arc4random system call")
/* Use arc4random system call */ /* Use arc4random system call */
return randombytes_bsd_randombytes(buf, n); return randombytes_bsd_randombytes(buf, n);
#elif defined(_WIN32) #elif defined(_WIN32)
# pragma message("Using Windows cryptographic API") //# pragma message("Using Windows cryptographic API")
/* Use windows API */ /* Use windows API */
return randombytes_win32_randombytes(buf, n); return randombytes_win32_randombytes(buf, n);
#else #else