2013-04-10 23:57:08 -07:00
|
|
|
#include <inttypes.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
|
#include <openssl/err.h>
|
|
|
|
|
#include <openssl/rand.h>
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
main()
|
|
|
|
|
{
|
2014-01-17 05:32:22 +00:00
|
|
|
uint32_t v;
|
2013-04-10 23:57:08 -07:00
|
|
|
|
2014-01-17 05:32:22 +00:00
|
|
|
if (RAND_bytes((unsigned char *)&v, sizeof v) == 0) {
|
|
|
|
|
ERR_print_errors_fp(stderr);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
printf("%" PRIu32 "\n", v);
|
|
|
|
|
return 0;
|
2013-04-10 23:57:08 -07:00
|
|
|
}
|