mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 18:25:05 +00:00
* Include trng.h from trng.c before any other header to verify that the header is self-contained. * Add inclusion of stdint.h to trng.h to provide definition for uint32_t. BUG=none BRANCH=none TEST=make -j buildall Change-Id: I78fb6d915c357236ca0fed2a57f093f0eec07fe9 Reviewed-on: https://chromium-review.googlesource.com/417424 Commit-Ready: Carl Hamilton <carlh@chromium.org> Tested-by: Carl Hamilton <carlh@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
33 lines
656 B
C
33 lines
656 B
C
/* Copyright 2015 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
#ifndef __EC_INCLUDE_TRNG_H
|
|
#define __EC_INCLUDE_TRNG_H
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
/**
|
|
* Initialize the true random number generator.
|
|
*
|
|
* Not supported by all platforms.
|
|
**/
|
|
void init_trng(void);
|
|
|
|
/**
|
|
* Retrieve a 32 bit random value.
|
|
*
|
|
* Not supported on all platforms.
|
|
**/
|
|
uint32_t rand(void);
|
|
|
|
/**
|
|
* Output len random bytes into buffer.
|
|
*
|
|
* Not supported on all platforms.
|
|
**/
|
|
void rand_bytes(void *buffer, size_t len);
|
|
|
|
#endif /* __EC_INCLUDE_TRNG_H */
|