mbox series

[v2,0/2] crypto: jitter - SHA-3 conditioner and test interface

Message ID 4825604.31r3eYUQgx@positron.chronox.de
Headers show
Series crypto: jitter - SHA-3 conditioner and test interface | expand

Message

Stephan Mueller April 10, 2023, 8:53 p.m. UTC
The patch set replaces the LFSR conditioning function of the Jitter RNG
with SHA-3 256. This change requires also a new test interface to
analyze the raw unconditioned noise data.

Albeit the test interface can be used directly with dd, a small helper
tool is provided at [1] which can be used to perform the collection
of raw entropy. The analysis of the data can be done with your favorite
tool. Or you may use the helper in [2] which uses the NIST SP800-90B
tool for entropy rate measurement.

[1] https://github.com/smuellerDD/jitterentropy-library/tree/master/tests/raw-entropy/recording_runtime_kernelspace

[2] https://github.com/smuellerDD/jitterentropy-library/tree/master/tests/raw-entropy/validation-runtime-kernel

Changes v2:

- fix use-after-free by switching shash_desc_zero and crypto_free_shash
  in jent_mod_init reported by kernel-test-robot

Stephan Mueller (2):
  crypto: jitter - replace LFSR with SHA3-256
  crypto: jitter - add interface for gathering of raw entropy

 crypto/Kconfig                 |  21 +++
 crypto/Makefile                |   1 +
 crypto/jitterentropy-kcapi.c   | 186 ++++++++++++++++++---
 crypto/jitterentropy-testing.c | 294 +++++++++++++++++++++++++++++++++
 crypto/jitterentropy.c         | 145 ++++++----------
 crypto/jitterentropy.h         |  20 ++-
 6 files changed, 547 insertions(+), 120 deletions(-)
 create mode 100644 crypto/jitterentropy-testing.c