]>
git.ipfire.org Git - thirdparty/u-boot.git/blob - include/rng.h
1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2019, Linaro Limited
9 #include <linux/types.h>
14 * dm_rng_read() - read a random number seed from the rng device
16 * The function blocks until the requested number of bytes is read.
18 * @dev: random number generator device
19 * @buffer: input buffer to put the read random seed into
20 * @size: number of random bytes to read
21 * Return: 0 if OK, -ve on error
23 int dm_rng_read(struct udevice
*dev
, void *buffer
, size_t size
);
26 * struct dm_rng_ops - operations for the hwrng uclass
28 * This structures contains the function implemented by a hardware random
29 * number generation device.
33 * @read: read a random bytes
35 * The function blocks until the requested number of bytes is read.
37 * @read.dev: random number generator device
38 * @read.data: input buffer to read the random seed into
39 * @read.max: number of random bytes to read
40 * @read.Return: 0 if OK, -ve on error
42 int (*read
)(struct udevice
*dev
, void *data
, size_t max
);