summaryrefslogtreecommitdiffstats
path: root/include/stdlib.h
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2017-03-22 10:14:34 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-30 08:23:20 +0200
commit07dc37dc9bbf0ddb2a4ef4e7baec07957492d42a (patch)
tree0c7f52db7442b5156be328b458ac98bc4cf21c35 /include/stdlib.h
parent8eac8a6c657274e4741518ba37ecde324ffe4186 (diff)
downloadbarebox-07dc37dc9bbf0ddb2a4ef4e7baec07957492d42a.tar.gz
barebox-07dc37dc9bbf0ddb2a4ef4e7baec07957492d42a.tar.xz
lib: random: add get_crypto_bytes interface and use HWRNG if posssible
For crypto applications we need to use some thing else as PRNG. So provide get_crypto_bytes() and use HWRNG as main source. PRNG is allowed as fallback if user decided to configure it so. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/stdlib.h')
-rw-r--r--include/stdlib.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/stdlib.h b/include/stdlib.h
index f3185069f3..ee3f229968 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -13,6 +13,7 @@ void srand(unsigned int seed);
/* fill a buffer with pseudo-random data */
void get_random_bytes(void *buf, int len);
+int get_crypto_bytes(void *buf, int len);
static inline u32 random32(void)
{