[PATCH 2/7] crypto: caam - fix hash, alg and rng registration if CAAM driver not initialized

2013-09-09 Thread Alex Porosanu
If the CAAM driver initialization failed (due to various reasons, e.g. RNG4 initialization failed), then the registration of hash/algorithms/rng shouldn't take place. This patch adds the necessary code to prevent this registration. Signed-off-by: Alex Porosanu --- drivers/crypto/caam/caamalg.c

[PATCH 0/7] crypto: caam - RNG4 patches and fixes

2013-09-09 Thread Alex Porosanu
This patch series attempts to fix some identified issues and add some new functionalities regarding the RNG4 block in the CAAM driver: o if the CAAM driver isn't properly instantiated (e.g. RNG4 initialization fails), then there's an illegal memory access generated by the modules depending on i

[PATCH 5/7] crypto: caam - uninstantiate RNG state handle 0 if instantiated by caam driver

2013-09-09 Thread Alex Porosanu
If the caam driver module instantiates the RNG state handle 0, then upon the removal of the module, the RNG state handle is left initialized. This patch takes care of reverting the state of the handle back to its previous uninstantatied state. Signed-off-by: Alex Porosanu --- drivers/crypto/caam

[PATCH 1/7] crypto: caam - fix RNG state handle instantiation descriptor

2013-09-09 Thread Alex Porosanu
The way the DECO runs a descriptor through the direct (debug) interface is different from the JRI interface: the DECO will continue to try and execute the next commands, after the descriptor buffer has ended. This leads to unpredictable results and possibly to locking up of the DECO. This patch add

Re: [PATCH] crypto: tegra: use kernel entropy instead of ad-hoc

2013-09-09 Thread Stephen Warren
On 09/09/2013 01:35 AM, Linus Walleij wrote: > The way I read the Tegra AES RNG is that it has a homebrew > algorithm for initializing the 128bit RNG using timespec and > the unique chip ID. This looks like reinventing the (square) > wheel, instead just grab 128bits from the kernel entropy pool > w

[PATCH 6/7] crypto: caam - fix RNG4 AAI defines

2013-09-09 Thread Alex Porosanu
RNG4 defines in desc.h were incomplete (bits AI & PS were missing), while SK was set as an ALG related bit. This patchs adds the missing bits and corrects the SK bit. Signed-off-by: Alex Porosanu --- drivers/crypto/caam/ctrl.c |2 +- drivers/crypto/caam/desc.h | 17 + 2 fil

[PATCH 7/7] crypto: caam - enable instantiation of all RNG4 state handles

2013-09-09 Thread Alex Porosanu
RNG4 block contains multiple (i.e. 2) state handles that can be initialized. This patch adds the necessary code for detecting which of the two state handles has been instantiated by another piece of software e.g. u-boot and instantiate the other one (or both if none was instantiated). Only the stat

[PATCH 4/7] crypto: caam - split RNG4 instantiation function

2013-09-09 Thread Alex Porosanu
This patch splits the RNG4 state handle instantiation function into two parts: one that handles the creation of the descriptor which instructs the CAAM to perform the instantiation of the state handle and another function that performs the running of the said descriptor using the DECO debug mechani

[PATCH 3/7] crypto: caam - fix RNG4 instantiation

2013-09-09 Thread Alex Porosanu
The RNG4 block in CAAM needs to be 'seeded' first before being used for generating pseudo-random data. The 'seeding' is done by getting entropy from the TRNG ring oscillator. The RTFRQMAX register controls the maximum allowable number of samples that can be aquired during an entropy sample. Dependi

[PATCH][RFC] Tests on 200 different CPUs/Arches and OSes with CPU Jitter RNG (resent)

2013-09-09 Thread Stephan Mueller
Hi Ted, (this is a reply to [3] and possibly an addition to your blog [4]) I prepared a new release of the CPU Jitter RNG available at [1]. The core of the RNG remains unchanged. However, there are the following changes: - addition of a patch to integrate the RNG into /dev/random as explained

[PATCH] crypto: tegra: use kernel entropy instead of ad-hoc

2013-09-09 Thread Linus Walleij
The way I read the Tegra AES RNG is that it has a homebrew algorithm for initializing the 128bit RNG using timespec and the unique chip ID. This looks like reinventing the (square) wheel, instead just grab 128bits from the kernel entropy pool where the time and (after another patch) chip unique ID