diff options
author | Tom Hughes <tomhughes@chromium.org> | 2022-06-17 17:15:14 -0700 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-06-28 00:28:45 +0000 |
commit | a6b0b3554f59cc9b0c4aae9bff7dff075f2089a9 (patch) | |
tree | e6cfc5ad8589d33ed5e3bbe9bbeac2719181a67c /include/trng.h | |
parent | d4e422b6bbfcb434092eaed39c3849ff75e797ce (diff) | |
download | chrome-ec-a6b0b3554f59cc9b0c4aae9bff7dff075f2089a9.tar.gz |
trng: Rename rand to trng_rand
The declaration for rand conflicts with the standard library declaration
so rename it from "rand" to "trng_rand". This has the benefit of making
it obvious when we're using the true random number generator.
For consistency, this also renames init_trng/exit_trng to
trng_init/trng_exit.
BRANCH=none
BUG=b:234181908
TEST=./util/compare_build.sh -b all -j 120
=> MATCH
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Ic3305a91263c45786c051eaa5b3689e7464aa0ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3712032
Reviewed-by: Bobby Casey <bobbycasey@google.com>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'include/trng.h')
-rw-r--r-- | include/trng.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/include/trng.h b/include/trng.h index cea4555b41..969366ae8e 100644 --- a/include/trng.h +++ b/include/trng.h @@ -14,32 +14,30 @@ * * Not supported by all platforms. **/ -void init_trng(void); +void trng_init(void); /** * Shutdown the true random number generator. * - * The opposite operation of init_trng(), disable the hardware resources + * The opposite operation of trng_init(), disable the hardware resources * used by the TRNG to save power. * * Not supported by all platforms. **/ -void exit_trng(void); +void trng_exit(void); /** * Retrieve a 32 bit random value. * * Not supported on all platforms. **/ -#ifndef HIDE_EC_STDLIB -uint32_t rand(void); -#endif +uint32_t trng_rand(void); /** * Output len random bytes into buffer. * * Not supported on all platforms. **/ -void rand_bytes(void *buffer, size_t len); +void trng_rand_bytes(void *buffer, size_t len); #endif /* __EC_INCLUDE_TRNG_H */ |