diff options
Diffstat (limited to 'src/wincompat/getrandom.c')
-rw-r--r-- | src/wincompat/getrandom.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/wincompat/getrandom.c b/src/wincompat/getrandom.c new file mode 100644 index 0000000..4e2c4bd --- /dev/null +++ b/src/wincompat/getrandom.c @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. + */ + +#include <stdbool.h> +#include <ntsecapi.h> + +static inline bool __attribute__((__warn_unused_result__)) get_random_bytes(uint8_t *out, size_t len) +{ + return RtlGenRandom(out, len); +} |