summaryrefslogtreecommitdiffstatshomepage
path: root/src/tools/wincompat/getrandom.c
blob: 4e2c4bd44be75a7937bcfe993078df911e66afa9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
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);
}