summaryrefslogtreecommitdiff
path: root/lib/Kconfig
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-11-11 12:20:37 +0100
committerDavid S. Miller <davem@davemloft.net>2013-11-11 14:32:15 -0500
commita6a9c0f1bf5a9a5faa605773ea75e0b93c3ab108 (patch)
treeaa0aee61cf99280eaa533956438c9daec3a2afc7 /lib/Kconfig
parenta98814cef87946d2708812ad9f8b1e03b8366b6f (diff)
random32: add test cases for taus113 implementation
We generated a battery of 100 test cases from GSL taus113 implemention and compare the results from a particular seed and a particular iteration with our implementation in the kernel. We have verified on 32 and 64 bit machines that our taus113 kernel implementation gives same results as GSL taus113 implementation: [ 0.147370] prandom: seed boundary self test passed [ 0.148078] prandom: 100 self tests passed This is a Kconfig option that is disabled on default, just like the crc32 init selftests in order to not unnecessary slow down boot process. We also refactored out prandom_seed_very_weak() as it's now used in multiple places in order to reduce redundant code. GSL code we used for generating test cases: int i, j; srand(time(NULL)); for (i = 0; i < 100; ++i) { int iteration = 500 + (rand() % 500); gsl_rng_default_seed = rand() + 1; gsl_rng *r = gsl_rng_alloc(gsl_rng_taus113); printf("\t{ %lu, ", gsl_rng_default_seed); for (j = 0; j < iteration - 1; ++j) gsl_rng_get(r); printf("%u, %lu },\n", iteration, gsl_rng_get(r)); gsl_rng_free(r); } Joint work with Hannes Frederic Sowa. Cc: Florian Weimer <fweimer@redhat.com> Cc: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/Kconfig')
-rw-r--r--lib/Kconfig7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Kconfig b/lib/Kconfig
index b3c8be0da17f..75485e163ca3 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -189,6 +189,13 @@ config AUDIT_GENERIC
depends on AUDIT && !AUDIT_ARCH
default y
+config RANDOM32_SELFTEST
+ bool "PRNG perform self test on init"
+ default n
+ help
+ This option enables the 32 bit PRNG library functions to perform a
+ self test on initialization.
+
#
# compression support is select'ed if needed
#