caam - IV source for IPsec decryption

2016-08-26 Thread Horia Ioan Geanta Neag
Herbert, Commits 7021b2e1cddd "esp4: Switch to new AEAD interface" 000ae7b2690e "esp6: Switch to new AEAD interface" removed the following: /* Get ivec. This can be wrong, check against another impls. */ iv = esph->enc_data; from IPsec decryption - esp{4,6}_input(), so the IV in re

[PATCH] hw_random: Remove check for max less than 4 bytes

2016-08-26 Thread PrasannaKumar Muralidharan
HW RNG core never asks for data less than 4 bytes. The check whether max is less than 4 bytes is unnecessary. Remove the check. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/meson-rng.c | 3 --- drivers/char/hw_random/st-rng.c| 3 --- 2 files changed, 6 deletions(-) d

[PATCH v2] crypto: caam - fix IV loading for authenc (giv)decryption

2016-08-26 Thread Horia Geantă
For algorithms that implement IV generators before the crypto ops, the IV needed for decryption is initially located in req->src scatterlist, not in req->iv. Avoid copying the IV into req->iv by modifying the (givdecrypt) descriptors to load it directly from req->src. aead_givdecrypt() is no longe

crypto: xor - Fix warning when XOR_SELECT_TEMPLATE is unset

2016-08-26 Thread Herbert Xu
On Thu, Aug 25, 2016 at 09:14:11PM +1000, Stephen Rothwell wrote: > > That looks fine to me. An alternative might be to have: > > #ifndef XOR_SELECT_TEMPLATE > #define XOR_SELECT_TEMPLATE(x)(x) > #endif > > near the top of the file. That gets the #ifdef out of the code flow > and serves

Re: [PATCH -next v2] chcr: Fix non static symbol warning

2016-08-26 Thread Herbert Xu
On Fri, Aug 26, 2016 at 02:21:08PM +, Wei Yongjun wrote: > From: Wei Yongjun > > Fixes the following sparse warning: > > drivers/crypto/chelsio/chcr_algo.c:593:5: warning: > symbol 'cxgb4_is_crypto_q_full' was not declared. Should it be static? > > Signed-off-by: Wei Yongjun Acked-by: He

Re: [PATCH] crypto: caam - fix IV loading for authenc (giv)decryption

2016-08-26 Thread Herbert Xu
On Fri, Aug 26, 2016 at 05:13:42PM +0300, Horia Geantă wrote: > > In terms of optimizations, would it be safe to assume all "geniv" authenc > algorithms - {echainiv, seqiv}(authenc) - get assoc,iv,ciphertext in > req->src for decryption? Yes. They all get the raw IPsec packet, apart from the ESN

[PATCH -next v2] chcr: Fix non static symbol warning

2016-08-26 Thread Wei Yongjun
From: Wei Yongjun Fixes the following sparse warning: drivers/crypto/chelsio/chcr_algo.c:593:5: warning: symbol 'cxgb4_is_crypto_q_full' was not declared. Should it be static? Signed-off-by: Wei Yongjun --- v1 -> v2: cc netdev maillist --- drivers/crypto/chelsio/chcr_algo.c | 2 +- 1 file ch

[PATCH] crypto: caam - fix IV loading for authenc (giv)decryption

2016-08-26 Thread Horia Geantă
For algorithms that implement IV generators before the crypto ops, the IV needed for decryption is initially located in req->src scatterlist, not in req->iv. aead_givdecrypt() is updated to put the IV in place. Cc: # 4.3+ Fixes: 479bcc7c5b9e ("crypto: caam - Convert authenc to new AEAD interface"

Re: [PATCH v2 5/5] hwrng: amd: Rework of the amd768-hwrng driver

2016-08-26 Thread Jason Cooper
Hi Corentin, On Fri, Aug 26, 2016 at 10:38:02AM +0200, LABBE Corentin wrote: > On Thu, Aug 25, 2016 at 02:56:38PM +, Jason Cooper wrote: > > On Thu, Aug 25, 2016 at 02:16:35PM +0200, LABBE Corentin wrote: > > > This patch convert the hwrng interface used by amd768-rng to its new API > > > by r

Re: caam - IV source for IPsec decryption

2016-08-26 Thread Herbert Xu
On Thu, Aug 25, 2016 at 04:12:35PM +, Horia Ioan Geanta Neag wrote: > Herbert, > > Commits > 7021b2e1cddd "esp4: Switch to new AEAD interface" > 000ae7b2690e "esp6: Switch to new AEAD interface" > removed the following: > /* Get ivec. This can be wrong, check against another impls. */ >

[PATCH v3 1/8] hwrng: amd: Fix style problem with blank line

2016-08-26 Thread LABBE Corentin
Some blank line are unncessary, and one is missing after declaration. This patch fix thoses style problems. Signed-off-by: LABBE Corentin --- drivers/char/hw_random/amd-rng.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/char/hw_random/amd-rng.c b/drivers/char/

caam - IV source for IPsec decryption

2016-08-26 Thread Horia Ioan Geanta Neag
Herbert, Commits 7021b2e1cddd "esp4: Switch to new AEAD interface" 000ae7b2690e "esp6: Switch to new AEAD interface" removed the following: /* Get ivec. This can be wrong, check against another impls. */ iv = esph->enc_data; from IPsec decryption - esp{4,6}_input(), so the IV in re

[PATCH v3 2/8] hwrng: amd: use the BIT macro

2016-08-26 Thread LABBE Corentin
This patch add usage of the BIT() macro Signed-off-by: LABBE Corentin --- drivers/char/hw_random/amd-rng.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/char/hw_random/amd-rng.c b/drivers/char/hw_random/amd-rng.c index 45b7965..d0042f5 100644 --- a/drivers/cha

[PATCH v3 3/8] hwrng: amd: Be consitent with the driver name

2016-08-26 Thread LABBE Corentin
The driver name is displayed each time differently. This patch make use of the same name everywhere. Signed-off-by: LABBE Corentin --- drivers/char/hw_random/amd-rng.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/char/hw_random/amd-rng.c b/drivers/char/

[PATCH v3 7/8] hwrng: amd: Access hardware via ioread32/iowrite32

2016-08-26 Thread LABBE Corentin
Instead of accessing hw directly via pmbase, it's better to access after ioport_map() via ioread32/iowrite32. Signed-off-by: LABBE Corentin --- drivers/char/hw_random/amd-rng.c | 31 +-- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/drivers/char/hw_ra

[PATCH v3 4/8] hwrng: amd: Remove asm/io.h

2016-08-26 Thread LABBE Corentin
checkpatch complains about used instead of linux/io.h. In fact it is not needed. This patch remove it, and in the process, alphabetize the other headers. Signed-off-by: LABBE Corentin --- drivers/char/hw_random/amd-rng.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a

[PATCH v3 5/8] hwrng: amd: release_region must be called after hwrng_unregister

2016-08-26 Thread LABBE Corentin
The driver release the memory region before being sure that nobody use it. This patch made hwrng_unregister ran before any release was done. Signed-off-by: LABBE Corentin --- drivers/char/hw_random/amd-rng.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/char/hw_r

[PATCH v3 8/8] hwrng: amd: Convert to new hwrng read() API

2016-08-26 Thread LABBE Corentin
This patch convert the hwrng interface used by amd768-rng to its new API by replacing data_read()/data_present() by read(). Signed-off-by: LABBE Corentin --- drivers/char/hw_random/amd-rng.c | 47 1 file changed, 28 insertions(+), 19 deletions(-) diff --

[PATCH v3 6/8] hwrng: amd: Replace global variable with private struct

2016-08-26 Thread LABBE Corentin
Instead of having two global variable, it's better to use a private struct. This will permit to remove amd_pdev variable Signed-off-by: LABBE Corentin --- drivers/char/hw_random/amd-rng.c | 57 ++-- 1 file changed, 38 insertions(+), 19 deletions(-) diff --git

[PATCH v3 0/8] hwrng: amd: rework of the amd hwrng driver

2016-08-26 Thread LABBE Corentin
Changes since v2: - split the latest patch in 4 Changes since v1: - Keep the hwrng name as "amd" LABBE Corentin (8): hwrng: amd: Fix style problem with blank line hwrng: amd: use the BIT macro hwrng: amd: Be consitent with the driver name hwrng: amd: Remove asm/io.h hwrng: amd: release

[PATCH] fix:caam:ctrl:add missing header dependencies

2016-08-26 Thread Baoyou Xie
We get 1 warning when biuld kernel with W=1: drivers/crypto/caam/ctrl.c:398:5: warning: no previous prototype for 'caam_get_era' [-Wmissing-prototypes] In fact, this function is declared in drivers/crypto/caam/ctrl.h, so this patch add missing header dependencies. Signed-off-by: Baoyou Xie ---

Re: [PATCH v2 5/5] hwrng: amd: Rework of the amd768-hwrng driver

2016-08-26 Thread LABBE Corentin
On Thu, Aug 25, 2016 at 02:56:38PM +, Jason Cooper wrote: > Hi Corentin, > > On Thu, Aug 25, 2016 at 02:16:35PM +0200, LABBE Corentin wrote: > > This patch convert the hwrng interface used by amd768-rng to its new API > > by replacing data_read()/data_present() by read(). > > > > Furthermore,