prng: debug-print seed if fetched from getrandom()

This commit is contained in:
CismonX 2025-06-19 16:49:41 +08:00
parent 72d55ed68f
commit 6c38779e78
No known key found for this signature in database
GPG key ID: 3094873E29A482FB

View file

@ -29,6 +29,7 @@
#include "prng.h" #include "prng.h"
#include <errno.h> #include <errno.h>
#include <inttypes.h>
#include <string.h> #include <string.h>
#include <sys/random.h> #include <sys/random.h>
@ -89,5 +90,8 @@ prng_seed (
// as many bytes as requested. // as many bytes as requested.
// This is guaranteed on both Linux and FreeBSD. // This is guaranteed on both Linux and FreeBSD.
debug_assert(nbytes == sizeof(state)); debug_assert(nbytes == sizeof(state));
debug_printf("prng seed: "
"%016" PRIx64 "%016" PRIx64 "%016" PRIx64 "%016" PRIx64,
state[0], state[1], state[2], state[3]);
return 0; return 0;
} }