Re: [PATCH v2 0/2] Propagate fallback bit for cbc and ctr

2017-03-06 Thread Marcelo Cerri
Hi Herbert, Any thoughts on this? On Mon, Feb 27, 2017 at 09:38:24AM -0300, Marcelo Henrique Cerri wrote: > Hi Hebert, > > For v2: > > - fixed the memory leakage in cbc. > - included crypto/algapi.h in crypto/cbc.c for crypto_requires_off(); > - ERR_CAST instead PTR_ERR in ctr. > - Also propaga

Re: [PATCH v2 1/2] crypto: vmx - Use skcipher for cbc fallback

2017-02-26 Thread Marcelo Cerri
On Fri, Feb 24, 2017 at 11:23:54AM -0300, Paulo Flabiano Smorigo wrote: > Signed-off-by: Paulo Flabiano Smorigo > --- > drivers/crypto/vmx/aes_cbc.c | 44 > ++-- > 1 file changed, 22 insertions(+), 22 deletions(-) > > diff --git a/drivers/crypto/vmx/aes_c

Re: crypto: hang in crypto_larval_lookup

2017-02-25 Thread Marcelo Cerri
On Sat, Feb 25, 2017 at 11:17:07PM +0800, Herbert Xu wrote: > On Fri, Feb 24, 2017 at 08:44:00PM -0300, Marcelo Cerri wrote: > > > > This is probably caused by the way that the xts template is handling the > > underline algorithm selection. > > Good catch. I think th

Re: crypto: hang in crypto_larval_lookup

2017-02-24 Thread Marcelo Cerri
On Thu, Feb 23, 2017 at 07:39:09PM +0800, Herbert Xu wrote: > On Thu, Feb 23, 2017 at 07:19:57PM +0800, Herbert Xu wrote: > > Harald Freudenberger wrote: > > > > > > Hello all > > > > > > I am currently following a hang at modprobe aes_s390 where > > > crypto_register_alg() does not come back fo

Re: [PATCH 1/2] crypto: vmx - Use skcipher for cbc fallback

2017-02-23 Thread Marcelo Cerri
It makes sense. Thanks for the clarification, Herbert. One more question: are you planning to convert the ctr template to skcipher? -- Regards, Marcelo On Thu, Feb 23, 2017 at 07:21:56PM +0800, Herbert Xu wrote: > Marcelo Cerri wrote: > > > > I noticed you used a similar approa

Re: [PATCH 1/2] crypto: vmx - Use skcipher for cbc fallback

2017-02-22 Thread Marcelo Cerri
Hi Hebert, On Wed, Feb 22, 2017 at 04:18:19PM -0300, Marcelo Cerri wrote: > Hi Paulo. > > On Wed, Feb 22, 2017 at 03:00:15PM -0300, Paulo Flabiano Smorigo wrote: > > > > if (in_interrupt()) { > > - ret = crypto_blkcipher_encry

Re: [PATCH 2/2] crypto: vmx - Use skcipher for xts fallback

2017-02-22 Thread Marcelo Cerri
In addition to cbc comments: On Wed, Feb 22, 2017 at 03:00:45PM -0300, Paulo Flabiano Smorigo wrote: > Signed-off-by: Paulo Flabiano Smorigo > --- > drivers/crypto/vmx/aes_xts.c | 32 ++-- > 1 file changed, 18 insertions(+), 14 deletions(-) > > diff --git a/drivers/c

Re: [PATCH 1/2] crypto: vmx - Use skcipher for cbc fallback

2017-02-22 Thread Marcelo Cerri
Hi Paulo. On Wed, Feb 22, 2017 at 03:00:15PM -0300, Paulo Flabiano Smorigo wrote: > Signed-off-by: Paulo Flabiano Smorigo > --- > drivers/crypto/vmx/aes_cbc.c | 41 - > 1 file changed, 20 insertions(+), 21 deletions(-) > > diff --git a/drivers/crypto/vmx/

Re: crypto: xts: regression in 4.10

2017-02-22 Thread Marcelo Cerri
What XTS implementations do you have available on /proc/crypto after the error? Some drivers that allocate fallback implementations using the older API started to fail after the generic templates were converted to skcipher. On Wed, Feb 22, 2017 at 12:17:17AM +0100, Nicolas Porcel wrote: > Hello,

Re: [PATCH 10/16] crypto: testmgr - Do not test internal algorithms

2016-11-10 Thread Marcelo Cerri
I tested this patch and it's working fine. -- Regards, Marcelo On Wed, Nov 02, 2016 at 07:19:12AM +0800, Herbert Xu wrote: > Currently we manually filter out internal algorithms using a list > in testmgr. This is dangerous as internal algorithms cannot be > safely used even by testmgr. This pa

[PATCH 2/3] crypto: testmgr - Add missing tests for internal sha256-mb implementation

2016-10-26 Thread Marcelo Cerri
Add null tests for the internal algorithm to avoid errors when running in FIPS mode. Signed-off-by: Marcelo Cerri --- crypto/testmgr.c | 8 1 file changed, 8 insertions(+) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index d999373..58f903d 100644 --- a/crypto/testmgr.c +++ b

[PATCH 3/3] crypto: testmgr - Add missing tests for internal sha512-mb implementation

2016-10-26 Thread Marcelo Cerri
Add null tests for the internal algorithm to avoid errors when running in FIPS mode. Signed-off-by: Marcelo Cerri --- crypto/testmgr.c | 8 1 file changed, 8 insertions(+) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 58f903d..cfafd24 100644 --- a/crypto/testmgr.c +++ b

[PATCH 0/3] crypto: testmgr - Add missing tests for internal sha*-mb implementations

2016-10-26 Thread Marcelo Cerri
This series adds null tests for all sha*-mb internal algorithms so they can be used in FIPS mode without further problems. Since they are 3 separated modules I decided to use a separated commit for each one. Marcelo Cerri (3): crypto: testmgr - Add missing tests for internal sha1-mb

[PATCH 1/3] crypto: testmgr - Add missing tests for internal sha1-mb implementation

2016-10-26 Thread Marcelo Cerri
Add null tests for the internal algorithm to avoid errors when running in FIPS mode. Signed-off-by: Marcelo Cerri --- crypto/testmgr.c | 8 1 file changed, 8 insertions(+) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index ded50b6..d999373 100644 --- a/crypto/testmgr.c +++ b

Re: [PATCH] crypto: sha1-powerpc: little-endian support

2016-10-04 Thread Marcelo Cerri
, 2016 at 05:23:16PM +1100, Michael Ellerman wrote: > Marcelo Cerri writes: > > > [ Unknown signature status ] > > On Wed, Sep 28, 2016 at 09:20:15PM +0800, Herbert Xu wrote: > >> On Wed, Sep 28, 2016 at 10:15:51AM -0300, Marcelo Cerri wrote: > >> > Hi Herbe

Re: [PATCH 0/3] Fix crypto/vmx/p8_ghash memory corruption

2016-10-03 Thread Marcelo Cerri
, Marcelo Cerri wrote: > This series fixes the memory corruption found by Jan Stancek in 4.8-rc7. The > problem however also affects previous versions of the driver. > > Marcelo Cerri (3): > crypto: ghash-generic - move common definitions to a new header file > crypto

Re: [PATCH 0/3] Fix crypto/vmx/p8_ghash memory corruption

2016-10-03 Thread Marcelo Cerri
Thank you. -- Regards, Marcelo On Sun, Oct 02, 2016 at 10:40:47PM +0800, Herbert Xu wrote: > On Thu, Sep 29, 2016 at 06:59:08AM +1000, Anton Blanchard wrote: > > Hi Marcelo > > > > > This series fixes the memory corruption found by Jan Stancek in > > > 4.8-rc7. The problem however also affects

[PATCH 1/3] crypto: ghash-generic - move common definitions to a new header file

2016-09-28 Thread Marcelo Cerri
Move common values and types used by ghash-generic to a new header file so drivers can directly use ghash-generic as a fallback implementation. Signed-off-by: Marcelo Cerri --- crypto/ghash-generic.c | 13 + include/crypto/ghash.h | 23 +++ 2 files changed, 24

[PATCH 3/3] crypto: vmx - Ensure ghash-generic is enabled

2016-09-28 Thread Marcelo Cerri
Add CRYPTO_GHASH as a dependency for vmx_crypto since p8_ghash uses it as the fallback implementation. Signed-off-by: Marcelo Cerri --- drivers/crypto/vmx/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/vmx/Kconfig b/drivers/crypto/vmx/Kconfig index

[PATCH 0/3] Fix crypto/vmx/p8_ghash memory corruption

2016-09-28 Thread Marcelo Cerri
This series fixes the memory corruption found by Jan Stancek in 4.8-rc7. The problem however also affects previous versions of the driver. Marcelo Cerri (3): crypto: ghash-generic - move common definitions to a new header file crypto: vmx - Fix memory corruption caused by p8_ghash crypto

[PATCH 2/3] crypto: vmx - Fix memory corruption caused by p8_ghash

2016-09-28 Thread Marcelo Cerri
Stancek Signed-off-by: Marcelo Cerri --- drivers/crypto/vmx/ghash.c | 31 --- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/crypto/vmx/ghash.c b/drivers/crypto/vmx/ghash.c index 6c999cb0..27a94a1 100644 --- a/drivers/crypto/vmx/ghash.c +++ b

Re: [PATCH] crypto: sha1-powerpc: little-endian support

2016-09-28 Thread Marcelo Cerri
On Wed, Sep 28, 2016 at 09:20:15PM +0800, Herbert Xu wrote: > On Wed, Sep 28, 2016 at 10:15:51AM -0300, Marcelo Cerri wrote: > > Hi Herbert, > > > > Any thoughts on this one? > > Can this patch wait until the next merge window? On the broken > platforms it should

Re: [PATCH] crypto: sha1-powerpc: little-endian support

2016-09-28 Thread Marcelo Cerri
Hi Herbert, Any thoughts on this one? -- Regards, Marcelo On Fri, Sep 23, 2016 at 04:31:56PM -0300, Marcelo Cerri wrote: > The driver does not handle endianness properly when loading the input > data. > > Signed-off-by: Marcelo Cerri > --- > arch/powerpc/crypto/sha1-

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Marcelo Cerri
On Wed, Sep 28, 2016 at 08:44:52PM +0800, Herbert Xu wrote: > On Wed, Sep 28, 2016 at 09:38:41AM -0300, Marcelo Cerri wrote: > > > > The patch forces ghash-generic as the fallback. And I don't think that > > is a big problem if we decide to go by this path. > >

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Marcelo Cerri
Hi Hebert, On Wed, Sep 28, 2016 at 08:29:35PM +0800, Herbert Xu wrote: > On Wed, Sep 28, 2016 at 03:40:51AM -0400, Jan Stancek wrote: > > > > Thanks for clearing up how this works in padlock-sha, but > > we are not exactly in same situation with p8_ghash. > > > > p8_ghash_init_tfm() already upda

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Marcelo Cerri
Hi Herbert, On Wed, Sep 28, 2016 at 10:45:49AM +0800, Herbert Xu wrote: > On Tue, Sep 27, 2016 at 04:46:44PM -0300, Marcelo Cerri wrote: > > > > Can you check if the problem occurs with this patch? > > In light of the fact that padlock-sha is the correct example > to foll

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-27 Thread Marcelo Cerri
Jan, Can you check if the problem occurs with this patch? --- drivers/crypto/vmx/ghash.c | 28 +--- drivers/crypto/vmx/vmx.c | 9 + 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/drivers/crypto/vmx/ghash.c b/drivers/crypto/vmx/ghash.c index 6

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-27 Thread Marcelo Cerri
Hi, On Tue, Sep 27, 2016 at 05:01:03AM -0400, Jan Stancek wrote: > So, if we extended p8_ghash_desc_ctx to accommodate fallback_desc's ctx > and then provided statesize/import/export, would that be acceptable? > > struct p8_ghash_desc_ctx { > ... > struct shash_desc fallback_desc;

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-26 Thread Marcelo Cerri
Herbert, Wouldn't be enough to provide a pair of import/export functions as the padlock-sha driver does? -- Regards, Marcelo On Mon, Sep 26, 2016 at 10:59:34PM +0800, Herbert Xu wrote: > On Fri, Sep 23, 2016 at 08:22:27PM -0400, Jan Stancek wrote: > > > > This seems to directly correspond with:

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-26 Thread Marcelo Cerri
Hi Jan, Just out of curiosity, have you tried to use "76" on both values to check if the problem still happens? -- Regards, Marcelo On Fri, Sep 23, 2016 at 08:22:27PM -0400, Jan Stancek wrote: > Hi, > > I'm chasing a memory corruption with 4.8-rc7 as I'm observing random Oopses > on ppc BE/LE

[PATCH] crypto: sha1-powerpc: little-endian support

2016-09-23 Thread Marcelo Cerri
The driver does not handle endianness properly when loading the input data. Signed-off-by: Marcelo Cerri --- arch/powerpc/crypto/sha1-powerpc-asm.S | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/crypto/sha1-powerpc-asm.S b/arch/powerpc/crypto

Re: crypto: GCM API usage

2013-10-03 Thread Marcelo Cerri
On Thu, Oct 03, 2013 at 08:03:45AM +0200, tobias.pol...@fau.de wrote: > > I haven't used the IV generation facility of the Crypto API, but it > > seems to be very straightforward although there's no documentation > > about that. > > > > You should use aead_givcrypt_set_callback(), aead_givcrypt_set

Re: crypto: GCM API usage

2013-09-19 Thread Marcelo Cerri
On Mon, Sep 16, 2013 at 08:34:11PM +0200, Dominik Paulus wrote: > Hi, > > On Mon, Sep 16, 2013 at 12:58:40PM +0200, > dominik.d.pau...@studium.uni-erlangen.de wrote: > > We are currently trying to add encryption support to the usbip kernel > > driver. Unfortunately, there is almost no documentati

Re: [PATCH] crypto_memcmp: add constant-time memcmp

2013-09-11 Thread Marcelo Cerri
The discussion that Daniel pointed out has another interesting point regarding the function name. I don't think it's a good idea to name it crypto_memcpy since it doesn't have behavior the same way as strcmp. Florian suggested in the thread names such crypto_mem_equal, which I think fits better he

[PATCH v2 04/10] crypto: nx - fix limits to sg lists for AES-CTR

2013-08-29 Thread Marcelo Cerri
bm,max-sync-cop": - The total number of bytes that a scatter/gather list can hold. - The maximum number of elements that a scatter/gather list can have. Reviewed-by: Joy Latten Signed-off-by: Marcelo Cerri --- drivers/crypto/nx/nx-aes-ctr.c | 50 ++

[PATCH v2 01/10] crypto: nx - add offset to nx_build_sg_lists()

2013-08-29 Thread Marcelo Cerri
This patch includes one more parameter to nx_build_sg_lists() to skip the given number of bytes from beginning of each sg list. This is needed in order to implement the fixes for the AES modes to make them able to process larger chunks of data. Reviewed-by: Joy Latten Signed-off-by: Marcelo

[PATCH v2 09/10] crypto: nx - fix GCM for zero length messages

2013-08-29 Thread Marcelo Cerri
atten Signed-off-by: Marcelo Cerri --- drivers/crypto/nx/nx-aes-gcm.c | 132 ++--- 1 file changed, 112 insertions(+), 20 deletions(-) diff --git a/drivers/crypto/nx/nx-aes-gcm.c b/drivers/crypto/nx/nx-aes-gcm.c index 9e89bdf..025d9a8 100644 --- a/drivers/crypto/nx/n

[PATCH v2 00/10] Series of fixes for NX driver

2013-08-29 Thread Marcelo Cerri
for AES-CCM Marcelo Cerri (8): crypto: nx - add offset to nx_build_sg_lists() crypto: nx - fix limits to sg lists for AES-ECB crypto: nx - fix limits to sg lists for AES-CBC crypto: nx - fix limits to sg lists for AES-CTR crypto: nx - fix limits to sg lists for AES-GCM crypto: nx - fix

[PATCH v2 06/10] crypto: nx - fix limits to sg lists for AES-XCBC

2013-08-29 Thread Marcelo Cerri
From: Fionnuala Gunter This patch updates the NX driver to perform several hyper calls when necessary so that the length limits of scatter/gather lists are respected. Reviewed-by: Joy Latten Reviewed-by: Marcelo Cerri Signed-off-by: Fionnuala Gunter --- drivers/crypto/nx/nx-aes-xcbc.c | 107

[PATCH v2 05/10] crypto: nx - fix limits to sg lists for AES-GCM

2013-08-29 Thread Marcelo Cerri
bm,max-sync-cop": - The total number of bytes that a scatter/gather list can hold. - The maximum number of elements that a scatter/gather list can have. Reviewed-by: Joy Latten Signed-off-by: Marcelo Cerri --- drivers/crypto/nx/nx-aes-gcm.c | 202 +++--

[PATCH v2 03/10] crypto: nx - fix limits to sg lists for AES-CBC

2013-08-29 Thread Marcelo Cerri
bm,max-sync-cop": - The total number of bytes that a scatter/gather list can hold. - The maximum number of elements that a scatter/gather list can have. Reviewed-by: Joy Latten Signed-off-by: Marcelo Cerri --- drivers/crypto/nx/nx-aes-cbc.c | 50 +-

[PATCH v2 10/10] crypto: nx - fix SHA-2 for chunks bigger than block size

2013-08-29 Thread Marcelo Cerri
than the block size. Reviewed-by: Joy Latten Signed-off-by: Marcelo Cerri --- drivers/crypto/nx/nx-sha256.c | 2 +- drivers/crypto/nx/nx-sha512.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/nx/nx-sha256.c b/drivers/crypto/nx/nx-sha256.c index 6547a71

[PATCH v2 08/10] crypto: nx - fix XCBC for zero length messages

2013-08-29 Thread Marcelo Cerri
place it with an implementation based on the RFC 3566 using ECB. Reviewed-by: Joy Latten Signed-off-by: Marcelo Cerri --- drivers/crypto/nx/nx-aes-xcbc.c | 84 + 1 file changed, 77 insertions(+), 7 deletions(-) diff --git a/drivers/crypto/nx/nx-aes-xcb

[PATCH v2 07/10] crypto: nx - fix limits to sg lists for AES-CCM

2013-08-29 Thread Marcelo Cerri
From: Fionnuala Gunter This patch updates the NX driver to perform several hyper calls when necessary so that the length limits of scatter/gather lists are respected. Reviewed-by: Marcelo Cerri Signed-off-by: Joy Latten Signed-off-by: Fionnuala Gunter --- drivers/crypto/nx/nx-aes-ccm.c

[PATCH v2 02/10] crypto: nx - fix limits to sg lists for AES-ECB

2013-08-29 Thread Marcelo Cerri
bm,max-sync-cop": - The total number of bytes that a scatter/gather list can hold. - The maximum number of elements that a scatter/gather list can have. Reviewed-by: Joy Latten Signed-off-by: Marcelo Cerri --- drivers/crypto/nx/nx-aes-ecb.c | 48 ++

Re: [PATCH 03/10] crypto: nx - fix limits to sg lists for AES-CBC

2013-08-29 Thread Marcelo Cerri
On Thu, Aug 29, 2013 at 02:42:22PM +1000, Herbert Xu wrote: > On Fri, Aug 23, 2013 at 05:01:07PM -0300, Marcelo Cerri wrote: > > This patch updates the nx-aes-cbc implementation to perform several > > hyper calls if needed in order to always respect the length limits for > >

[PATCH 02/10] crypto: nx - fix limits to sg lists for AES-ECB

2013-08-23 Thread Marcelo Cerri
bm,max-sync-cop": - The total number of bytes that a scatter/gather list can hold. - The maximum number of elements that a scatter/gather list can have. Reviewed-by: Joy Latten Signed-off-by: Marcelo Cerri --- drivers/crypto/nx/nx-aes-ecb.c | 48 ++

[PATCH 00/10] Series of fixes for NX driver

2013-08-23 Thread Marcelo Cerri
modes. - Fixes in how the driver handle zero length messages. This affects XCBC and GCM. - Fixes for SHA-2 when chunks bigger than the block size are provided. Fionnuala Gunter (2): crypto: nx - fix limits to sg lists for AES-XCBC crypto: nx - fix limits to sg lists for AES-CCM Marcelo

[PATCH 01/10] crypto: nx - add offset to nx_build_sg_lists()

2013-08-23 Thread Marcelo Cerri
This patch includes one more parameter to nx_build_sg_lists() to skip the given number of bytes from beginning of each sg list. This is needed in order to implement the fixes for the AES modes to make them able to process larger chunks of data. Reviewed-by: Joy Latten Signed-off-by: Marcelo

[PATCH 03/10] crypto: nx - fix limits to sg lists for AES-CBC

2013-08-23 Thread Marcelo Cerri
bm,max-sync-cop": - The total number of bytes that a scatter/gather list can hold. - The maximum number of elements that a scatter/gather list can have. Reviewed-by: Joy Latten Signed-off-by: Marcelo Cerri --- drivers/crypto/nx/nx-aes-cbc.c | 50 +-

[PATCH 07/10] crypto: nx - fix limits to sg lists for AES-CCM

2013-08-23 Thread Marcelo Cerri
From: Fionnuala Gunter This patch updates the NX driver to perform several hyper calls when necessary so that the length limits of scatter/gather lists are respected. Reviewed-by: Marcelo Cerri Signed-off-by: Joy Latten Signed-off-by: Fionnuala Gunter --- drivers/crypto/nx/nx-aes-ccm.c

[PATCH 04/10] crypto: nx - fix limits to sg lists for AES-CTR

2013-08-23 Thread Marcelo Cerri
bm,max-sync-cop": - The total number of bytes that a scatter/gather list can hold. - The maximum number of elements that a scatter/gather list can have. Reviewed-by: Joy Latten Signed-off-by: Marcelo Cerri --- drivers/crypto/nx/nx-aes-ctr.c | 50 ++

[PATCH 06/10] crypto: nx - fix limits to sg lists for AES-XCBC

2013-08-23 Thread Marcelo Cerri
From: Fionnuala Gunter This patch updates the NX driver to perform several hyper calls when necessary so that the length limits of scatter/gather lists are respected. Reviewed-by: Joy Latten Reviewed-by: Marcelo Cerri Signed-off-by: Fionnuala Gunter --- drivers/crypto/nx/nx-aes-xcbc.c | 107

[PATCH 10/10] crypto: nx - fix SHA-2 for chunks bigger than block size

2013-08-23 Thread Marcelo Cerri
than the block size. Reviewed-by: Joy Latten Signed-off-by: Marcelo Cerri --- drivers/crypto/nx/nx-sha256.c | 2 +- drivers/crypto/nx/nx-sha512.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/nx/nx-sha256.c b/drivers/crypto/nx/nx-sha256.c index 6547a71

[PATCH 09/10] crypto: nx - fix GCM for zero length messages

2013-08-23 Thread Marcelo Cerri
atten Signed-off-by: Marcelo Cerri --- drivers/crypto/nx/nx-aes-gcm.c | 132 ++--- 1 file changed, 112 insertions(+), 20 deletions(-) diff --git a/drivers/crypto/nx/nx-aes-gcm.c b/drivers/crypto/nx/nx-aes-gcm.c index 9e89bdf..025d9a8 100644 --- a/drivers/crypto/nx/n

[PATCH 08/10] crypto: nx - fix XCBC for zero length messages

2013-08-23 Thread Marcelo Cerri
place it with an implementation based on the RFC 3566 using ECB. Reviewed-by: Joy Latten Signed-off-by: Marcelo Cerri --- drivers/crypto/nx/nx-aes-xcbc.c | 84 + 1 file changed, 77 insertions(+), 7 deletions(-) diff --git a/drivers/crypto/nx/nx-aes-xcb

[PATCH 05/10] crypto: nx - fix limits to sg lists for AES-GCM

2013-08-23 Thread Marcelo Cerri
bm,max-sync-cop": - The total number of bytes that a scatter/gather list can hold. - The maximum number of elements that a scatter/gather list can have. Reviewed-by: Joy Latten Signed-off-by: Marcelo Cerri --- drivers/crypto/nx/nx-aes-gcm.c | 202 +++--

[PATCH] crypto: nx - fix concurrency issue

2013-08-12 Thread Marcelo Cerri
locks to protect the data where a race condition can happen. Reviewed-by: Fionnuala Gunter Reviewed-by: Joy Latten Signed-off-by: Marcelo Cerri --- drivers/crypto/nx/nx-aes-cbc.c | 10 -- drivers/crypto/nx/nx-aes-ccm.c | 20 drivers/crypto/nx/nx-aes-ctr.c | 10

Re: Questions about the Crypto API

2013-08-12 Thread Marcelo Cerri
On Sat, Aug 10, 2013 at 11:15:41AM +1000, Herbert Xu wrote: > On Fri, Aug 09, 2013 at 01:09:12PM +, Hsieh, Che-Min wrote: > > Marcelo/Herbert: > > > > I believe It is. Herbert, please correct me if I am wrong. > > A single tfm is used as a user context to crypto, so to speak. But a user > > i

Re: Questions about the Crypto API

2013-08-09 Thread Marcelo Cerri
06, 2013 12:30 PM > > To: Marcelo Cerri > > Cc: linux-crypto@vger.kernel.org > > Subject: Re: Questions about the Crypto API > > > > On Mon, Aug 05, 2013 at 05:25:57PM -0300, Marcelo Cerri wrote: > > > > > > My first doubt is regarding which kind of conc

Re: Questions about the Crypto API

2013-08-06 Thread Marcelo Cerri
EP in one of these structures? And in which one? Since cryptographic methods can be called in softirq contexts, is the caller responsible for setting this flag correctly based on the context it is running? Regards, Marcelo On Tue, Aug 06, 2013 at 09:05:41AM -0300, Marcelo Cerri wrote: > Hi

Re: Questions about the Crypto API

2013-08-06 Thread Marcelo Cerri
Hi Herbert, Thanks for your answers. On Tue, Aug 06, 2013 at 05:00:10PM +1000, Herbert Xu wrote: > On Mon, Aug 05, 2013 at 05:25:57PM -0300, Marcelo Cerri wrote: > > > > My first doubt is regarding which kind of concurrency the Crypto API > > allows. For example, can a sing

Questions about the Crypto API

2013-08-05 Thread Marcelo Cerri
Hi, I'm starting to work on some platform-specific implementations using the Crypto API. I spent some time reading the available documentation and mainly the code, but I still have some doubts on how the Crypto API works and how it should be used. My first doubt is regarding which kind of concurr

[PATCH v2 1/2] drivers/crypto/nx: fix physical addresses added to sg lists

2013-08-02 Thread Marcelo Cerri
keeps incrementing it even when a page boundary is crossed. This patch fixes this behaviour. Reviewed-by: Fionnuala Gunter Reviewed-by: Joel Schopp Reviewed-by: Joy Latten Signed-off-by: Marcelo Cerri --- drivers/crypto/nx/nx.c | 22 +++--- 1 file changed, 19 insertions(

[PATCH v2 2/2] drivers/crypto/nx: fix limits to sg lists for SHA-2

2013-08-02 Thread Marcelo Cerri
atten Signed-off-by: Marcelo Cerri --- drivers/crypto/nx/nx-sha256.c | 108 +++- drivers/crypto/nx/nx-sha512.c | 113 -- 2 files changed, 129 insertions(+), 92 deletions(-) diff --git a/drivers/crypto/nx/nx-sha256.c b/drivers

[PATCH v2 0/2] drivers/crypto/nx: fixes when input data is too large

2013-08-02 Thread Marcelo Cerri
Reviewed-By tags where it is appropriate. Marcelo Cerri (2): drivers/crypto/nx: fix physical addresses added to sg lists drivers/crypto/nx: fix limits to sg lists for SHA-2 drivers/crypto/nx/nx-sha256.c | 108 +++- drivers/crypto/nx/nx-sha512.c

Re: [PATCH 2/2] drivers/crypto/nx: fix limits to sg lists for SHA-2

2013-07-29 Thread Marcelo Cerri
, Benjamin Herrenschmidt wrote: > On Fri, 2013-07-26 at 14:08 -0300, Marcelo Cerri wrote: > > > > Signed-off-by: Fionnuala Gunter > > Signed-off-by: Joel Schopp > > Signed-off-by: Joy Latten > > Signed-off-by: Marcelo Cerri > > --- > > Why that enormou

Re: [PATCH 2/2] drivers/crypto/nx: fix limits to sg lists for SHA-2

2013-07-29 Thread Marcelo Cerri
We think that it's very likely that AES may also be affected by a similar problem. But we still have to test it and I'd like to provide a separated patch for it. Regards, Marcelo On Sat, Jul 27, 2013 at 08:31:32AM +1000, Benjamin Herrenschmidt wrote: > On Fri, 2013-07-26 at 14:08 -

[PATCH 2/2] drivers/crypto/nx: fix limits to sg lists for SHA-2

2013-07-26 Thread Marcelo Cerri
atten Signed-off-by: Marcelo Cerri --- drivers/crypto/nx/nx-sha256.c | 108 +++- drivers/crypto/nx/nx-sha512.c | 113 -- 2 files changed, 129 insertions(+), 92 deletions(-) diff --git a/drivers/crypto/nx/nx-sha256.c b/

[PATCH 1/2] drivers/crypto/nx: fix physical addresses added to sg lists

2013-07-26 Thread Marcelo Cerri
keeps incrementing it even when a page boundary is crossed. This patch fixes this behaviour. Signed-off-by: Fionnuala Gunter Signed-off-by: Joel Schopp Signed-off-by: Joy Latten Signed-off-by: Marcelo Cerri --- drivers/crypto/nx/nx.c | 22 +++--- 1 file changed, 19 insertions(

[PATCH 0/2] drivers/crypto/nx: fixes when input data is too large

2013-07-26 Thread Marcelo Cerri
This series of patches fixes two bugs that are triggered when the input data is too large. The first one is caused by the miscalculation of physical addresses and the second one by some limits that the co-processor has to the input data. Marcelo Cerri (2): drivers/crypto/nx: fix physical