[PATCH v38 03/13] LRNG - sysctls and /proc interface

2021-02-27 Thread Stephan Müller
The LRNG sysctl interface provides the same controls as the existing /dev/random implementation. These sysctls behave identically and are implemented identically. The goal is to allow a possible merge of the existing /dev/random implementation with this implementation which implies that this patch

[PATCH v38 00/13] /dev/random - a new approach

2021-02-27 Thread Stephan Müller
Hi, The following patch set provides a different approach to /dev/random which is called Linux Random Number Generator (LRNG) to collect entropy within the Linux kernel. It provides the same API and ABI and can be used as a drop-in replacement. The LRNG implements at least all features of the exi

[PATCH v38 12/13] LRNG - add interface for gathering of raw entropy

2021-02-27 Thread Stephan Müller
The test interface allows a privileged process to capture the raw unconditioned noise that is collected by the LRNG for statistical analysis. Such testing allows the analysis how much entropy the interrupt noise source provides on a given platform. Extracted noise data is not used to seed the LRNG.

[PATCH v38 11/13] LRNG - add SP800-90B compliant health tests

2021-02-27 Thread Stephan Müller
Implement health tests for LRNG's slow noise sources as mandated by SP-800-90B The file contains the following health tests: - stuck test: The stuck test calculates the first, second and third discrete derivative of the time stamp to be processed by the hash for the per-CPU entropy pool. Only

[PATCH v38 01/13] Linux Random Number Generator

2021-02-27 Thread Stephan Müller
In an effort to provide a flexible implementation for a random number generator that also delivers entropy during early boot time, allows replacement of the deterministic random number generation mechanism, implement the various components in separate code for easier maintenance, and provide compli

[PATCH v38 08/13] LRNG - add kernel crypto API PRNG extension

2021-02-27 Thread Stephan Müller
Add runtime-pluggable support for all PRNGs that are accessible via the kernel crypto API, including hardware PRNGs. The PRNG is selected with the module parameter drng_name where the name must be one that the kernel crypto API can resolve into an RNG. This allows using of the kernel crypto API PR

[PATCH v38 04/13] LRNG - add switchable DRNG support

2021-02-27 Thread Stephan Müller
The DRNG switch support allows replacing the DRNG mechanism of the LRNG. The switching support rests on the interface definition of include/linux/lrng.h. A new DRNG is implemented by filling in the interface defined in this header file. In addition to the DRNG, the extension also has to provide a

[PATCH v38 06/13] crypto: DRBG - externalize DRBG functions for LRNG

2021-02-27 Thread Stephan Müller
This patch allows several DRBG functions to be called by the LRNG kernel code paths outside the drbg.c file. CC: Torsten Duwe CC: "Eric W. Biederman" CC: "Alexander E. Patrakov" CC: "Ahmed S. Darwish" CC: "Theodore Y. Ts'o" CC: Willy Tarreau CC: Matthew Garrett CC: Vito Caputo CC: Andreas

[PATCH v38 07/13] LRNG - add SP800-90A DRBG extension

2021-02-27 Thread Stephan Müller
Using the LRNG switchable DRNG support, the SP800-90A DRBG extension is implemented. The DRBG uses the kernel crypto API DRBG implementation. In addition, it uses the kernel crypto API SHASH support to provide the hashing operation. The DRBG supports the choice of either a CTR DRBG using AES-256,

[PATCH v38 05/13] LRNG - add common generic hash support

2021-02-27 Thread Stephan Müller
The LRNG switchable DRNG support also allows the replacement of the hash implementation used as conditioning component. The common generic hash support code provides the required callbacks using the synchronous hash implementations of the kernel crypto API. All synchronous hash implementations sup

[PATCH v38 09/13] crypto: provide access to a static Jitter RNG state

2021-02-27 Thread Stephan Müller
To support the LRNG operation which uses the Jitter RNG separately from the kernel crypto API, at a time where potentially the regular memory management is not yet initialized, the Jitter RNG needs to provide a state whose memory is defined at compile time. As only once instance will ever be needed

[PATCH v38 02/13] LRNG - allocate one DRNG instance per NUMA node

2021-02-27 Thread Stephan Müller
In order to improve NUMA-locality when serving getrandom(2) requests, allocate one DRNG instance per node. The DRNG instance that is present right from the start of the kernel is reused as the first per-NUMA-node DRNG. For all remaining online NUMA nodes a new DRNG instance is allocated. During b

[PATCH v38 10/13] LRNG - add Jitter RNG fast noise source

2021-02-27 Thread Stephan Müller
The Jitter RNG fast noise source implemented as part of the kernel crypto API is queried for 256 bits of entropy at the time the seed buffer managed by the LRNG is about to be filled. CC: Torsten Duwe CC: "Eric W. Biederman" CC: "Alexander E. Patrakov" CC: "Ahmed S. Darwish" CC: "Theodore Y. T

[PATCH v38 13/13] LRNG - add power-on and runtime self-tests

2021-02-27 Thread Stephan Müller
Parts of the LRNG are already covered by self-tests, including: * Self-test of SP800-90A DRBG provided by the Linux kernel crypto API. * Self-test of the PRNG provided by the Linux kernel crypto API. * Raw noise source data testing including SP800-90B compliant tests when enabling CONFIG_LRNG_

Re: [PATCH v2 0/7] Add KDF implementations to crypto API

2021-01-24 Thread Stephan Müller
Am Sonntag, 24. Januar 2021, 15:32:59 CET schrieb Ard Biesheuvel: Hi Ard, > On Sun, 24 Jan 2021 at 15:23, Ard Biesheuvel wrote: > > On Sun, 24 Jan 2021 at 15:10, Stephan Müller wrote: > > > Hi, > > > > > > The key derviation functions are considered to be

Re: [PATCH v2 0/7] Add KDF implementations to crypto API

2021-01-24 Thread Stephan Müller
Am Sonntag, 24. Januar 2021, 15:23:29 CET schrieb Ard Biesheuvel: Hi Ard, > On Sun, 24 Jan 2021 at 15:10, Stephan Müller wrote: > > Hi, > > > > The key derviation functions are considered to be a cryptographic > > operation. As cryptographic operations are provide

[PATCH v2 0/7] Add KDF implementations to crypto API

2021-01-24 Thread Stephan Müller
Hi, The key derviation functions are considered to be a cryptographic operation. As cryptographic operations are provided via the kernel crypto API, this patch set consolidates the KDF implementations into the crypto API. The KDF implementations are provided as service functions. Yet, the interfa

[PATCH v2 6/7] fs: use HKDF implementation from kernel crypto API

2021-01-24 Thread Stephan Müller
As the kernel crypto API implements HKDF, replace the file-system-specific HKDF implementation with the generic HKDF implementation. Signed-off-by: Stephan Mueller --- fs/crypto/Kconfig | 2 +- fs/crypto/hkdf.c | 98 +-- 2 files changed, 20 insertion

[PATCH v2 4/7] security: DH - remove dead code for zero padding

2021-01-24 Thread Stephan Müller
Remove the specific code that adds a zero padding that was intended to be invoked when the DH operation result was smaller than the modulus. However, this cannot occur any more these days because the function mpi_write_to_sgl is used in the code path that calculates the shared secret in dh_compute_

[PATCH v2 1/7] crypto: Add key derivation self-test support code

2021-01-24 Thread Stephan Müller
As a preparation to add the key derivation implementations, the self-test data structure definition and the common test code is made available. The test framework follows the testing applied by the NIST CAVP test approach. The structure of the test code follows the implementations found in crypto

[PATCH v2 2/7] crypto: add SP800-108 counter key derivation function

2021-01-24 Thread Stephan Müller
SP800-108 defines three KDFs - this patch provides the counter KDF implementation. The KDF is implemented as a service function where the caller has to maintain the hash / HMAC state. Apart from this hash/HMAC state, no additional state is required to be maintained by either the caller or the KDF

[PATCH v2 3/7] crypto: add RFC5869 HKDF

2021-01-24 Thread Stephan Müller
RFC5869 specifies an extract and expand two-step key derivation function. The HKDF implementation is provided as a service function that operates on a caller-provided HMAC handle. The caller has to allocate the HMAC shash handle and then can invoke the HKDF service functions. The HKDF implementatio

[PATCH v2 5/7] security: DH - use KDF implementation from crypto API

2021-01-24 Thread Stephan Müller
The kernel crypto API provides the SP800-108 counter KDF implementation. Thus, the separate implementation provided as part of the keys subsystem can be replaced with calls to the KDF offered by the kernel crypto API. The keys subsystem uses the counter KDF with a hash primitive. Thus, it only use

[PATCH v2 7/7] fs: HKDF - remove duplicate memory clearing

2021-01-24 Thread Stephan Müller
The clearing of the OKM memory buffer in case of an error is already performed by the HKDF implementation crypto_hkdf_expand. Thus, the code clearing is not needed any more in the file system code base. Signed-off-by: Stephan Mueller --- fs/crypto/hkdf.c | 9 +++-- 1 file changed, 3 insertio

[PATCH 1/5] crypto: Add key derivation self-test support code

2021-01-04 Thread Stephan Müller
As a preparation to add the key derivation implementations, the self-test data structure definition and the common test code is made available. The test framework follows the testing applied by the NIST CAVP test approach. The structure of the test code follows the implementations found in crypto

[PATCH 0/5] Add KDF implementations to crypto API

2021-01-04 Thread Stephan Müller
Hi, The key derviation functions are considered to be a cryptographic operation. As cryptographic operations are provided via the kernel crypto API, this patch set consolidates the KDF implementations into the crypto API. The KDF implementations are provided as service functions. Yet, the interfa

[PATCH 2/5] crypto: add SP800-108 counter key derivation function

2021-01-04 Thread Stephan Müller
SP800-108 defines three KDFs - this patch provides the counter KDF implementation. The KDF is implemented as a service function where the caller has to maintain the hash / HMAC state. Apart from this hash/HMAC state, no additional state is required to be maintained by either the caller or the KDF

[PATCH 4/5] security: DH - use KDF implementation from crypto API

2021-01-04 Thread Stephan Müller
The kernel crypto API provides the SP800-108 counter KDF implementation. Thus, the separate implementation provided as part of the keys subsystem can be replaced with calls to the KDF offered by the kernel crypto API. The keys subsystem uses the counter KDF with a hash cipher primitive. Thus, it o

[PATCH 3/5] crypto: add RFC5869 HKDF

2021-01-04 Thread Stephan Müller
RFC5869 specifies an extract and expand two-step key derivation function. The HKDF implementation is provided as a service function that operates on a caller-provided HMAC cipher handle. The caller has to allocate the HMAC cipher and then can invoke the HKDF service functions. The HKDF implementati

[PATCH 5/5] fs: use HKDF implementation from kernel crypto API

2021-01-04 Thread Stephan Müller
As the kernel crypto API implements HKDF, replace the file-system-specific HKDF implementation with the generic HKDF implementation. Signed-off-by: Stephan Mueller --- fs/crypto/Kconfig | 2 +- fs/crypto/fscrypt_private.h | 4 +- fs/crypto/hkdf.c| 108 +-

Re: [PATCH v4 4/5] crypto: hisilicon/hpre - add 'ECDH' algorithm

2020-12-19 Thread Stephan Müller
Am Donnerstag, 17. Dezember 2020, 04:07:30 CET schrieb yumeng: Hi yumeng, > > I see in "SEC 2: Recommended Elliptic Curve Domain ParametersVersion2.0" > that 'Recommend Elliptic Curve Domain Parameters over Fp' are secp192, > secp224, secp256, secp384, and secp521, secp128 and secp320 are not >

[PATCH v36 05/13] LRNG - add common generic hash support

2020-10-19 Thread Stephan Müller
The LRNG switchable DRNG support also allows the replacement of the hash implementation used as conditioning component. The common generic hash support code provides the required callbacks using the synchronous hash implementations of the kernel crypto API. All synchronous hash implementations sup

[PATCH v36 12/13] LRNG - add interface for gathering of raw entropy

2020-10-19 Thread Stephan Müller
The test interface allows a privileged process to capture the raw unconditioned noise that is collected by the LRNG for statistical analysis. Such testing allows the analysis how much entropy the interrupt noise source provides on a given platform. Extracted noise data is not used to seed the LRNG.

[PATCH v36 01/13] Linux Random Number Generator

2020-10-19 Thread Stephan Müller
In an effort to provide a flexible implementation for a random number generator that also delivers entropy during early boot time, allows replacement of the deterministic random number generation mechanism, implement the various components in separate code for easier maintenance, and provide compli

[PATCH v36 03/13] LRNG - sysctls and /proc interface

2020-10-19 Thread Stephan Müller
The LRNG sysctl interface provides the same controls as the existing /dev/random implementation. These sysctls behave identically and are implemented identically. The goal is to allow a possible merge of the existing /dev/random implementation with this implementation which implies that this patch

[PATCH v36 07/13] LRNG - add SP800-90A DRBG extension

2020-10-19 Thread Stephan Müller
Using the LRNG switchable DRNG support, the SP800-90A DRBG extension is implemented. The DRBG uses the kernel crypto API DRBG implementation. In addition, it uses the kernel crypto API SHASH support to provide the hashing operation. The DRBG supports the choice of either a CTR DRBG using AES-256,

[PATCH v36 02/13] LRNG - allocate one DRNG instance per NUMA node

2020-10-19 Thread Stephan Müller
In order to improve NUMA-locality when serving getrandom(2) requests, allocate one DRNG instance per node. The DRNG instance that is present right from the start of the kernel is reused as the first per-NUMA-node DRNG. For all remaining online NUMA nodes a new DRNG instance is allocated. During b

[PATCH v36 04/13] LRNG - add switchable DRNG support

2020-10-19 Thread Stephan Müller
The DRNG switch support allows replacing the DRNG mechanism of the LRNG. The switching support rests on the interface definition of include/linux/lrng.h. A new DRNG is implemented by filling in the interface defined in this header file. In addition to the DRNG, the extension also has to provide a

[PATCH v36 13/13] LRNG - add power-on and runtime self-tests

2020-10-19 Thread Stephan Müller
Parts of the LRNG are already covered by self-tests, including: * Self-test of SP800-90A DRBG provided by the Linux kernel crypto API. * Self-test of the PRNG provided by the Linux kernel crypto API. * Raw noise source data testing including SP800-90B compliant tests when enabling CONFIG_LRNG_

[PATCH v36 06/13] crypto: DRBG - externalize DRBG functions for LRNG

2020-10-19 Thread Stephan Müller
This patch allows several DRBG functions to be called by the LRNG kernel code paths outside the drbg.c file. CC: Torsten Duwe CC: "Eric W. Biederman" CC: "Alexander E. Patrakov" CC: "Ahmed S. Darwish" CC: "Theodore Y. Ts'o" CC: Willy Tarreau CC: Matthew Garrett CC: Vito Caputo CC: Andreas

[PATCH v36 00/13] /dev/random - a new approach

2020-10-19 Thread Stephan Müller
Hi, The following patch set provides a different approach to /dev/random which is called Linux Random Number Generator (LRNG) to collect entropy within the Linux kernel. It provides the same API and ABI and can be used as a drop-in replacement. The LRNG implements at least all features of the exi

[PATCH v36 09/13] crypto: provide access to a static Jitter RNG state

2020-10-19 Thread Stephan Müller
To support the LRNG operation which uses the Jitter RNG separately from the kernel crypto API, at a time where potentially the regular memory management is not yet initialized, the Jitter RNG needs to provide a state whose memory is defined at compile time. As only once instance will ever be needed

[PATCH v36 11/13] LRNG - add SP800-90B compliant health tests

2020-10-19 Thread Stephan Müller
Implement health tests for LRNG's slow noise sources as mandated by SP-800-90B The file contains the following health tests: - stuck test: The stuck test calculates the first, second and third discrete derivative of the time stamp to be processed by the hash for the per-CPU entropy pool. Only

[PATCH v36 08/13] LRNG - add kernel crypto API PRNG extension

2020-10-19 Thread Stephan Müller
Add runtime-pluggable support for all PRNGs that are accessible via the kernel crypto API, including hardware PRNGs. The PRNG is selected with the module parameter drng_name where the name must be one that the kernel crypto API can resolve into an RNG. This allows using of the kernel crypto API PR

[PATCH v36 10/13] LRNG - add Jitter RNG fast noise source

2020-10-19 Thread Stephan Müller
The Jitter RNG fast noise source implemented as part of the kernel crypto API is queried for 256 bits of entropy at the time the seed buffer managed by the LRNG is about to be filled. CC: Torsten Duwe CC: "Eric W. Biederman" CC: "Alexander E. Patrakov" CC: "Ahmed S. Darwish" CC: "Theodore Y. T

[PATCH] crypto: jitterentropy - bind statically into kernel

2020-10-04 Thread Stephan Müller
The RISC-V architecture is about to implement the callback random_get_entropy with a function that is not exported to modules. Thus, the Jitter RNG is changed to be only bound statically into the kernel removing the option to compile it as module. Reported-by: Christoph Hellwig Signed-off-by: Ste

[PATCH v35 02/13] LRNG - allocate one DRNG instance per NUMA node

2020-09-18 Thread Stephan Müller
In order to improve NUMA-locality when serving getrandom(2) requests, allocate one DRNG instance per node. The DRNG instance that is present right from the start of the kernel is reused as the first per-NUMA-node DRNG. For all remaining online NUMA nodes a new DRNG instance is allocated. During b

[PATCH v35 00/13] /dev/random - a new approach

2020-09-18 Thread Stephan Müller
Hi, The following patch set provides a different approach to /dev/random which is called Linux Random Number Generator (LRNG) to collect entropy within the Linux kernel. The following advantages compared to the existing /dev/random implementation are present: * Sole use of crypto for data proces

[PATCH v35 06/13] crypto: DRBG - externalize DRBG functions for LRNG

2020-09-18 Thread Stephan Müller
This patch allows several DRBG functions to be called by the LRNG kernel code paths outside the drbg.c file. CC: "Eric W. Biederman" CC: "Alexander E. Patrakov" CC: "Ahmed S. Darwish" CC: "Theodore Y. Ts'o" CC: Willy Tarreau CC: Matthew Garrett CC: Vito Caputo CC: Andreas Dilger CC: Jan Ka

[PATCH v35 05/13] LRNG - add common generic hash support

2020-09-18 Thread Stephan Müller
The LRNG switchable DRNG support also allows the replacement of the hash implementation used as conditioning component. The common generic hash support code provides the required callbacks using the synchronous hash implementations of the kernel crypto API. All synchronous hash implementations sup

[PATCH v35 04/13] LRNG - add switchable DRNG support

2020-09-18 Thread Stephan Müller
The DRNG switch support allows replacing the DRNG mechanism of the LRNG. The switching support rests on the interface definition of include/linux/lrng.h. A new DRNG is implemented by filling in the interface defined in this header file. In addition to the DRNG, the extension also has to provide a

[PATCH v35 10/13] LRNG - add Jitter RNG fast noise source

2020-09-18 Thread Stephan Müller
The Jitter RNG fast noise source implemented as part of the kernel crypto API is queried for 256 bits of entropy at the time the seed buffer managed by the LRNG is about to be filled. CC: "Eric W. Biederman" CC: "Alexander E. Patrakov" CC: "Ahmed S. Darwish" CC: "Theodore Y. Ts'o" CC: Willy Ta

[PATCH v35 11/13] LRNG - add SP800-90B compliant health tests

2020-09-18 Thread Stephan Müller
Implement health tests for LRNG's slow noise sources as mandated by SP-800-90B The file contains the following health tests: - stuck test: The stuck test calculates the first, second and third discrete derivative of the time stamp to be processed by the hash for the per-CPU entropy pool. Only

[PATCH v35 09/13] crypto: provide access to a static Jitter RNG state

2020-09-18 Thread Stephan Müller
To support the LRNG operation which uses the Jitter RNG separately from the kernel crypto API, at a time where potentially the regular memory management is not yet initialized, the Jitter RNG needs to provide a state whose memory is defined at compile time. As only once instance will ever be needed

[PATCH v35 12/13] LRNG - add interface for gathering of raw entropy

2020-09-18 Thread Stephan Müller
The test interface allows a privileged process to capture the raw unconditioned noise that is collected by the LRNG for statistical analysis. Such testing allows the analysis how much entropy the interrupt noise source provides on a given platform. Extracted noise data is not used to seed the LRNG.

[PATCH v35 13/13] LRNG - add power-on and runtime self-tests

2020-09-18 Thread Stephan Müller
Parts of the LRNG are already covered by self-tests, including: * Self-test of SP800-90A DRBG provided by the Linux kernel crypto API. * Self-test of the PRNG provided by the Linux kernel crypto API. * Raw noise source data testing including SP800-90B compliant tests when enabling CONFIG_LRNG_

[PATCH v35 01/13] Linux Random Number Generator

2020-09-18 Thread Stephan Müller
In an effort to provide a flexible implementation for a random number generator that also delivers entropy during early boot time, allows replacement of the deterministic random number generation mechanism, implement the various components in separate code for easier maintenance, and provide compli

[PATCH v35 03/13] LRNG - sysctls and /proc interface

2020-09-18 Thread Stephan Müller
The LRNG sysctl interface provides the same controls as the existing /dev/random implementation. These sysctls behave identically and are implemented identically. The goal is to allow a possible merge of the existing /dev/random implementation with this implementation which implies that this patch

[PATCH v35 07/13] LRNG - add SP800-90A DRBG extension

2020-09-18 Thread Stephan Müller
Using the LRNG switchable DRNG support, the SP800-90A DRBG extension is implemented. The DRBG uses the kernel crypto API DRBG implementation. In addition, it uses the kernel crypto API SHASH support to provide the hashing operation. The DRBG supports the choice of either a CTR DRBG using AES-256,

[PATCH v35 08/13] LRNG - add kernel crypto API PRNG extension

2020-09-18 Thread Stephan Müller
Add runtime-pluggable support for all PRNGs that are accessible via the kernel crypto API, including hardware PRNGs. The PRNG is selected with the module parameter drng_name where the name must be one that the kernel crypto API can resolve into an RNG. This allows using of the kernel crypto API PR

[PATCH v34 08/12] crypto: provide access to a static Jitter RNG state

2020-08-25 Thread Stephan Müller
To support the LRNG operation which uses the Jitter RNG separately from the kernel crypto API, at a time where potentially the regular memory management is not yet initialized, the Jitter RNG needs to provide a state whose memory is defined at compile time. As only once instance will ever be needed

[PATCH v34 09/12] LRNG - add Jitter RNG fast noise source

2020-08-25 Thread Stephan Müller
The Jitter RNG fast noise source implemented as part of the kernel crypto API is queried for 256 bits of entropy at the time the seed buffer managed by the LRNG is about to be filled. CC: "Eric W. Biederman" CC: "Alexander E. Patrakov" CC: "Ahmed S. Darwish" CC: "Theodore Y. Ts'o" CC: Willy Ta

[PATCH v34 07/12] LRNG - add kernel crypto API PRNG extension

2020-08-25 Thread Stephan Müller
Add runtime-pluggable support for all PRNGs that are accessible via the kernel crypto API, including hardware PRNGs. The PRNG is selected with the module parameter drng_name where the name must be one that the kernel crypto API can resolve into an RNG. This allows using of the kernel crypto API PR

[PATCH v34 10/12] LRNG - add SP800-90B compliant health tests

2020-08-25 Thread Stephan Müller
Implement health tests for LRNG's slow noise sources as mandated by SP-800-90B The file contains the following health tests: - stuck test: The stuck test calculates the first, second and third discrete derivative of the time stamp to be processed by the LFSR. Only if all three values are non-z

[PATCH v34 12/12] LRNG - add power-on and runtime self-tests

2020-08-25 Thread Stephan Müller
Parts of the LRNG are already covered by self-tests, including: * Self-test of SP800-90A DRBG provided by the Linux kernel crypto API. * Self-test of the PRNG provided by the Linux kernel crypto API. * Raw noise source data testing including SP800-90B compliant tests when enabling CONFIG_LRNG_

[PATCH v34 02/12] LRNG - allocate one DRNG instance per NUMA node

2020-08-25 Thread Stephan Müller
In order to improve NUMA-locality when serving getrandom(2) requests, allocate one DRNG instance per node. The DRNG instance that is present right from the start of the kernel is reused as the first per-NUMA-node DRNG. For all remaining online NUMA nodes a new DRNG instance is allocated. During b

[PATCH v34 03/12] LRNG - sysctls and /proc interface

2020-08-25 Thread Stephan Müller
The LRNG sysctl interface provides the same controls as the existing /dev/random implementation. These sysctls behave identically and are implemented identically. The goal is to allow a possible merge of the existing /dev/random implementation with this implementation which implies that this patch

[PATCH v34 11/12] LRNG - add interface for gathering of raw entropy

2020-08-25 Thread Stephan Müller
The test interface allows a privileged process to capture the raw unconditioned noise that is collected by the LRNG for statistical analysis. Such testing allows the analysis how much entropy the interrupt noise source provides on a given platform. Extracted noise data is not used to seed the LRNG.

[PATCH v34 01/12] Linux Random Number Generator

2020-08-25 Thread Stephan Müller
In an effort to provide a flexible implementation for a random number generator that also delivers entropy during early boot time, allows replacement of the deterministic random number generation mechanism, implement the various components in separate code for easier maintenance, and provide compli

[PATCH v34 06/12] LRNG - add SP800-90A DRBG extension

2020-08-25 Thread Stephan Müller
Using the LRNG switchable DRNG support, the SP800-90A DRBG extension is implemented. The DRBG uses the kernel crypto API DRBG implementation. In addition, it uses the kernel crypto API SHASH support to provide the hashing operation. The DRBG supports the choice of either a CTR DRBG using AES-256,

[PATCH v34 00/12] /dev/random - a new approach with full SP800-90B compliance

2020-08-25 Thread Stephan Müller
Hi, The following patch set provides a different approach to /dev/random which is called Linux Random Number Generator (LRNG) to collect entropy within the Linux kernel. The main improvements compared to the existing /dev/random is to provide sufficient entropy during boot time as well as in virtu

[PATCH v34 04/12] LRNG - add switchable DRNG support

2020-08-25 Thread Stephan Müller
The DRNG switch support allows replacing the DRNG mechanism of the LRNG. The switching support rests on the interface definition of include/linux/lrng.h. A new DRNG is implemented by filling in the interface defined in this header file. In addition to the DRNG, the extension also has to provide a

[PATCH v34 05/12] crypto: DRBG - externalize DRBG functions for LRNG

2020-08-25 Thread Stephan Müller
This patch allows several DRBG functions to be called by the LRNG kernel code paths outside the drbg.c file. CC: "Eric W. Biederman" CC: "Alexander E. Patrakov" CC: "Ahmed S. Darwish" CC: "Theodore Y. Ts'o" CC: Willy Tarreau CC: Matthew Garrett CC: Vito Caputo CC: Andreas Dilger CC: Jan Ka

Re: [PATCH v33 01/12] Linux Random Number Generator

2020-08-21 Thread Stephan Müller
Am Freitag, 21. August 2020, 21:42:17 CEST schrieb kernel test robot: Hi, > >hppa-linux-ld: lib/random32.o: in function `prandom_u32': > >> (.text+0x318): undefined reference to `__tracepoint_prandom_u32' > >> hppa-linux-ld: (.text+0x31c): undefined reference to > >> `__tracepoint_prandom_u32

[PATCH v33 08/12] crypto: provide access to a static Jitter RNG state

2020-08-20 Thread Stephan Müller
To support the LRNG operation which uses the Jitter RNG separately from the kernel crypto API, at a time where potentially the regular memory management is not yet initialized, the Jitter RNG needs to provide a state whose memory is defined at compile time. As only once instance will ever be needed

[PATCH v33 06/12] LRNG - add SP800-90A DRBG extension

2020-08-20 Thread Stephan Müller
Using the LRNG switchable DRNG support, the SP800-90A DRBG extension is implemented. The DRBG uses the kernel crypto API DRBG implementation. In addition, it uses the kernel crypto API SHASH support to provide the hashing operation. The DRBG supports the choice of either a CTR DRBG using AES-256,

[PATCH v33 07/12] LRNG - add kernel crypto API PRNG extension

2020-08-20 Thread Stephan Müller
Add runtime-pluggable support for all PRNGs that are accessible via the kernel crypto API, including hardware PRNGs. The PRNG is selected with the module parameter drng_name where the name must be one that the kernel crypto API can resolve into an RNG. This allows using of the kernel crypto API PR

[PATCH v33 00/12] /dev/random - a new approach with full SP800-90B compliance

2020-08-20 Thread Stephan Müller
Hi, The following patch set provides a different approach to /dev/random which is called Linux Random Number Generator (LRNG) to collect entropy within the Linux kernel. The main improvements compared to the existing /dev/random is to provide sufficient entropy during boot time as well as in virtu

[PATCH v33 05/12] crypto: DRBG - externalize DRBG functions for LRNG

2020-08-20 Thread Stephan Müller
This patch allows several DRBG functions to be called by the LRNG kernel code paths outside the drbg.c file. CC: "Eric W. Biederman" CC: "Alexander E. Patrakov" CC: "Ahmed S. Darwish" CC: "Theodore Y. Ts'o" CC: Willy Tarreau CC: Matthew Garrett CC: Vito Caputo CC: Andreas Dilger CC: Jan Ka

[PATCH v33 09/12] LRNG - add Jitter RNG fast noise source

2020-08-20 Thread Stephan Müller
From 4a94cf2db12d5d1f8fd3354ea0da2c5726f96ac7 Mon Sep 17 00:00:00 2001 From: Stephan Mueller Date: Sun, 19 Jan 2020 21:23:17 +0100 Subject: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Jitter RNG fast noise source implemented as part of the kernel

[PATCH v33 02/12] LRNG - allocate one DRNG instance per NUMA node

2020-08-20 Thread Stephan Müller
In order to improve NUMA-locality when serving getrandom(2) requests, allocate one DRNG instance per node. The DRNG instance that is present right from the start of the kernel is reused as the first per-NUMA-node DRNG. For all remaining online NUMA nodes a new DRNG instance is allocated. During b

[PATCH v33 04/12] LRNG - add switchable DRNG support

2020-08-20 Thread Stephan Müller
The DRNG switch support allows replacing the DRNG mechanism of the LRNG. The switching support rests on the interface definition of include/linux/lrng.h. A new DRNG is implemented by filling in the interface defined in this header file. In addition to the DRNG, the extension also has to provide a

[PATCH v33 01/12] Linux Random Number Generator

2020-08-20 Thread Stephan Müller
In an effort to provide a flexible implementation for a random number generator that also delivers entropy during early boot time, allows replacement of the deterministic random number generation mechanism, implement the various components in separate code for easier maintenance, and provide compli

[PATCH v33 10/12] LRNG - add SP800-90B compliant health tests

2020-08-20 Thread Stephan Müller
Implement health tests for LRNG's slow noise sources as mandated by SP-800-90B The file contains the following health tests: - stuck test: The stuck test calculates the first, second and third discrete derivative of the time stamp to be processed by the LFSR. Only if all three values are non-z

[PATCH v33 03/12] LRNG - sysctls and /proc interface

2020-08-20 Thread Stephan Müller
The LRNG sysctl interface provides the same controls as the existing /dev/random implementation. These sysctls behave identically and are implemented identically. The goal is to allow a possible merge of the existing /dev/random implementation with this implementation which implies that this patch

[PATCH v33 12/12] LRNG - add power-on and runtime self-tests

2020-08-20 Thread Stephan Müller
Parts of the LRNG are already covered by self-tests, including: * Self-test of SP800-90A DRBG provided by the Linux kernel crypto API. * Self-test of the PRNG provided by the Linux kernel crypto API. * Raw noise source data testing including SP800-90B compliant tests when enabling CONFIG_LRNG_

[PATCH v33 11/12] LRNG - add interface for gathering of raw entropy

2020-08-20 Thread Stephan Müller
The test interface allows a privileged process to capture the raw unconditioned noise that is collected by the LRNG for statistical analysis. Such testing allows the analysis how much entropy the interrupt noise source provides on a given platform. Extracted noise data is not used to seed the LRNG.

Re: [PATCH v32 01/12] Linux Random Number Generator

2020-08-20 Thread Stephan Müller
Am Donnerstag, 20. August 2020, 13:46:49 CEST schrieb kernel test robot: Hi, > All warnings (new ones prefixed by >>): > >> drivers/char/lrng/lrng_interfaces.c:120:6: warning: no previous prototype > >> for 'add_hwgenerator_randomness' [-Wmissing-prototypes] > 120 | void add_hwgenerator_rand

Re: [PATCH v32 06/12] LRNG - add SP800-90A DRBG extension

2020-08-20 Thread Stephan Müller
Am Donnerstag, 20. August 2020, 14:07:40 CEST schrieb kernel test robot: Hi, > > All warnings (new ones prefixed by >>): > >> drivers/char/lrng/lrng_drbg.c:226:1: warning: 'static' is not at > >> beginning of declaration [-Wold-style-declaration] > 226 | const static struct lrng_crypto_cb l

[PATCH v32 10/12] LRNG - add SP800-90B compliant health tests

2020-08-20 Thread Stephan Müller
Implement health tests for LRNG's slow noise sources as mandated by SP-800-90B The file contains the following health tests: - stuck test: The stuck test calculates the first, second and third discrete derivative of the time stamp to be processed by the LFSR. Only if all three values are non-z

[PATCH v32 01/12] Linux Random Number Generator

2020-08-20 Thread Stephan Müller
In an effort to provide a flexible implementation for a random number generator that also delivers entropy during early boot time, allows replacement of the deterministic random number generation mechanism, implement the various components in separate code for easier maintenance, and provide compli

[PATCH v32 02/12] LRNG - allocate one DRNG instance per NUMA node

2020-08-20 Thread Stephan Müller
In order to improve NUMA-locality when serving getrandom(2) requests, allocate one DRNG instance per node. The DRNG instance that is present right from the start of the kernel is reused as the first per-NUMA-node DRNG. For all remaining online NUMA nodes a new DRNG instance is allocated. During b

[PATCH v32 04/12] LRNG - add switchable DRNG support

2020-08-20 Thread Stephan Müller
The DRNG switch support allows replacing the DRNG mechanism of the LRNG. The switching support rests on the interface definition of include/linux/lrng.h. A new DRNG is implemented by filling in the interface defined in this header file. In addition to the DRNG, the extension also has to provide a

[PATCH v32 03/12] LRNG - sysctls and /proc interface

2020-08-20 Thread Stephan Müller
The LRNG sysctl interface provides the same controls as the existing /dev/random implementation. These sysctls behave identically and are implemented identically. The goal is to allow a possible merge of the existing /dev/random implementation with this implementation which implies that this patch

[PATCH v32 06/12] LRNG - add SP800-90A DRBG extension

2020-08-20 Thread Stephan Müller
Using the LRNG switchable DRNG support, the SP800-90A DRBG extension is implemented. The DRBG uses the kernel crypto API DRBG implementation. In addition, it uses the kernel crypto API SHASH support to provide the hashing operation. The DRBG supports the choice of either a CTR DRBG using AES-256,

[PATCH v32 09/12] LRNG - add Jitter RNG fast noise source

2020-08-20 Thread Stephan Müller
The Jitter RNG fast noise source implemented as part of the kernel crypto API is queried for 256 bits of entropy at the time the seed buffer managed by the LRNG is about to be filled. CC: "Eric W. Biederman" CC: "Alexander E. Patrakov" CC: "Ahmed S. Darwish" CC: "Theodore Y. Ts'o" CC: Willy Ta

[PATCH v32 00/12] /dev/random - a new approach with full SP800-90B compliance

2020-08-20 Thread Stephan Müller
Hi, The following patch set provides a different approach to /dev/random which is called Linux Random Number Generator (LRNG) to collect entropy within the Linux kernel. The main improvements compared to the existing /dev/random is to provide sufficient entropy during boot time as well as in virtu

[PATCH v32 08/12] crypto: provide access to a static Jitter RNG state

2020-08-20 Thread Stephan Müller
To support the LRNG operation which uses the Jitter RNG separately from the kernel crypto API, at a time where potentially the regular memory management is not yet initialized, the Jitter RNG needs to provide a state whose memory is defined at compile time. As only once instance will ever be needed

[PATCH v32 11/12] LRNG - add interface for gathering of raw entropy

2020-08-20 Thread Stephan Müller
The test interface allows a privileged process to capture the raw unconditioned noise that is collected by the LRNG for statistical analysis. Such testing allows the analysis how much entropy the interrupt noise source provides on a given platform. Extracted noise data is not used to seed the LRNG.

[PATCH v32 05/12] crypto: DRBG - externalize DRBG functions for LRNG

2020-08-20 Thread Stephan Müller
This patch allows several DRBG functions to be called by the LRNG kernel code paths outside the drbg.c file. CC: "Eric W. Biederman" CC: "Alexander E. Patrakov" CC: "Ahmed S. Darwish" CC: "Theodore Y. Ts'o" CC: Willy Tarreau CC: Matthew Garrett CC: Vito Caputo CC: Andreas Dilger CC: Jan Ka

  1   2   3   4   5   6   >