CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
Toggle main menu visibility
Loading...
Searching...
No Matches
sdk
include
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
__cheriot_compartment("randombytes") int randombytes(uint8_t *output
Populate output with n bytes of entropy from the system's entropy source.
Generated by
1.18.0