blob: da3ce1a1a558f2af2bb086393d69ee4b0f72d578 (
about) (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
/*
* SPDX-License-Identifier: CC0-1.0
*
* Copyright (C) 2025 W. Kosior <koszko@koszko.org>
*/
#include <stdio.h>
#include <sys/random.h>
#include "pqcrypto_prng_getrandom.h"
void prng_getrandom(void * buf, size_t buf_len, void * state) {
(void) state;
if (getrandom(buf, buf_len, 0) != (ssize_t) buf_len) {
fprintf(stderr, "Failed to get %zu random bytes.\n", buf_len);
abort();
}
}
|