CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
Loading...
Searching...
No Matches
randombytes.h
Go to the documentation of this file.
1#pragma once
2
3#include <cdefs.h>
4#include <stddef.h>
5#include <stdint.h>
6
7/**
8 * \file
9 *
10 * API for accessing a shared entropy source in the `randombytes` compartment.
11 */
12
13__BEGIN_DECLS
14
15/**
16 * Populate `output` with `n` bytes of entropy from the system's entropy source.
17 *
18 * This will be cryptographically secure entropy if and only if the system
19 * entropy source is cryptographically secure.
20 *
21 * Returns 0 on success.
22 */
23__cheriot_compartment("randombytes") int randombytes(uint8_t *output, size_t n);
24
25__END_DECLS
__cheriot_compartment("randombytes") int randombytes(uint8_t *output
Populate output with n bytes of entropy from the system's entropy source.