|
@@ -1663,6 +1663,21 @@ int wait_for_random_bytes(void)
|
|
}
|
|
}
|
|
EXPORT_SYMBOL(wait_for_random_bytes);
|
|
EXPORT_SYMBOL(wait_for_random_bytes);
|
|
|
|
|
|
|
|
+/*
|
|
|
|
+ * Returns whether or not the urandom pool has been seeded and thus guaranteed
|
|
|
|
+ * to supply cryptographically secure random numbers. This applies to: the
|
|
|
|
+ * /dev/urandom device, the get_random_bytes function, and the get_random_{u32,
|
|
|
|
+ * ,u64,int,long} family of functions.
|
|
|
|
+ *
|
|
|
|
+ * Returns: true if the urandom pool has been seeded.
|
|
|
|
+ * false if the urandom pool has not been seeded.
|
|
|
|
+ */
|
|
|
|
+bool rng_is_initialized(void)
|
|
|
|
+{
|
|
|
|
+ return crng_ready();
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL(rng_is_initialized);
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Add a callback function that will be invoked when the nonblocking
|
|
* Add a callback function that will be invoked when the nonblocking
|
|
* pool is initialised.
|
|
* pool is initialised.
|