[PATCH] crypto: skcipher: Don't use __crypto_dequeue_request()

2014-05-26 Thread Marek Vasut
Use skcipher_givcrypt_cast(crypto_dequeue_request(queue)) instead, which does the same thing in much cleaner way. The skcipher_givcrypt_cast() actually uses container_of() instead of messing around with offsetof() too. Signed-off-by: Marek Vasut Reported-by: Arnd Bergmann Cc: Herbert Xu Cc: Pan

Re: [QUESTION] Crypto queue handling

2014-05-26 Thread Marek Vasut
Hello again, > Hello, > > I'm digging in crypto/algapi.c , in the crypto_enqueue_request() function. > I don't quite understand how the backlog mechanism should work. According > to [1], I suspect it should limit the amount of requests in the queue to > $max_qlen and allow one more request to be

[QUESTION] Crypto queue handling

2014-05-26 Thread Marek Vasut
Hello, I'm digging in crypto/algapi.c , in the crypto_enqueue_request() function. I don't quite understand how the backlog mechanism should work. According to [1], I suspect it should limit the amount of requests in the queue to $max_qlen and allow one more request to be enqueued into the $back

[PATCH] crypto: Move crypto_yield() to algapi.h

2014-05-26 Thread Marek Vasut
It makes no sense for crypto_yield() to be defined in scatterwalk.h , move it into algapi.h as it's an internal function to crypto API. Signed-off-by: Marek Vasut Cc: Herbert Xu --- include/crypto/algapi.h | 6 ++ include/crypto/scatterwalk.h | 6 -- 2 files changed, 6 insertions(+

[PATCH v8 0/7] SP800-90A Deterministic Random Bit Generator

2014-05-26 Thread Stephan Mueller
Hi, the following set of patches implements the deterministic random bit generator (DRBG) specified by SP800-90A. The DRBG implementation offers the following: * All three DRBG types are implemented with a derivation function. * All DRBG types are available with and without predi

[PATCH v8 2/7] header file for DRBG

2014-05-26 Thread Stephan Mueller
The header file includes the definition of: * DRBG data structures with - struct drbg_state as main structure - struct drbg_core referencing the backend ciphers - struct drbg_state_ops callbach handlers for specific code supporting the Hash, HMAC, CTR DRBG impleme

[PATCH v8 3/7] DRBG kernel configuration options

2014-05-26 Thread Stephan Mueller
The different DRBG types of CTR, Hash, HMAC can be enabled or disabled at compile time. At least one DRBG type shall be selected. The default is the HMAC DRBG as its code base is smallest. Signed-off-by: Stephan Mueller --- crypto/Kconfig | 36 +++- 1 file change

[PATCH v8 4/7] compile the DRBG code

2014-05-26 Thread Stephan Mueller
Signed-off-by: Stephan Mueller --- crypto/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/Makefile b/crypto/Makefile index 38e64231..bfa94fa 100644 --- a/crypto/Makefile +++ b/crypto/Makefile @@ -92,6 +92,7 @@ obj-$(CONFIG_CRYPTO_842) += 842.o obj-$(CONFIG_CRYPTO_RNG2) += rn

[PATCH v8 5/7] DRBG testmgr test vectors

2014-05-26 Thread Stephan Mueller
All types of the DRBG (CTR, HMAC, Hash) are covered with test vectors. In addition, all permutations of use cases of the DRBG are covered: * with and without predition resistance * with and without additional information string * with and without personalization string As

[PATCH v8 6/7] Add DRBG test code to testmgr

2014-05-26 Thread Stephan Mueller
lThe DRBG test code implements the CAVS test approach. As discussed for the test vectors, all DRBG types are covered with testing. However, not every backend cipher is covered with testing. To prevent the testmgr from logging missing testing, the NULL test is registered for all backend ciphers not

[PATCH v8 7/7] Add documentation of drbg.stdrng

2014-05-26 Thread Stephan Mueller
The drbg.stdrng kernel command line flag allows the selection of the DRBG used as stdrng. Signed-off-by: Stephan Mueller --- Documentation/kernel-parameters.txt | 10 ++ 1 file changed, 10 insertions(+) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.