Re: [PATCH 3/4] crypto: caamhash: add two missed dma_mapping_error

2015-03-02 Thread yjin
On 2015年03月02日 19:53, Horia Geantă wrote: On 2/28/2015 8:00 AM, yanjiang@windriver.com wrote: From: Yanjiang Jin Add two missed dma_mapping_error() after dma_map_single(). Signed-off-by: Yanjiang Jin --- drivers/crypto/caam/caamhash.c | 8 1 file changed, 8 insertions(+) di

Re: [PATCH 4/4] crypto: caamhash: replace kmalloc with kzalloc

2015-03-02 Thread yjin
On 2015年03月02日 19:03, Horia Geantă wrote: On 2/28/2015 8:00 AM, yanjiang@windriver.com wrote: From: Yanjiang Jin This can make sure we get a clean memory, else system would report the below warning: I'd avoid using kzalloc, it's an overhead on the hot path. kmalloc can be used with a bit

[PATCH 3/3] crypto: caamhash: - fix uninitialized edesc->sec4_sg_bytes field

2015-03-02 Thread yanjiang.jin
From: Yanjiang Jin sec4_sg_bytes not being properly initialized causes ahash_done to try to free unallocated DMA memory: caam_jr ffe301000.jr: DMA-API: device driver tries to free DMA memory it has not allocated [device address=0xdeadbeefdeadbeef] [size=3735928559 bytes] [ cut here

[PATCH 1/3] crypto: caam: fix some compile warnings

2015-03-02 Thread yanjiang.jin
From: Yanjiang Jin This commit is to avoid the below warnings: drivers/crypto/caam/sg_sw_sec4.h:88:12: warning: 'dma_map_sg_chained' defined but not used [-Wunused-function] static int dma_map_sg_chained(struct device *dev, struct scatterlist *sg, ^ drivers/crypto/caam/sg_sw_sec4.h:

[PATCH 2/3] crypto: caam_rng: fix rng_unmap_ctx's DMA_UNMAP size problem

2015-03-02 Thread yanjiang.jin
From: Yanjiang Jin Fix rng_unmap_ctx's DMA_UNMAP size problem for caam_rng, else system would report the below calltrace during kexec boot: caam_jr ffe301000.jr: DMA-API: device driver frees DMA memory with different size [device address=0x7f080010] [map size=16 bytes] [unmap size=40 b

[PATCH 0/3] fix some CAAM warnings.

2015-03-02 Thread yanjiang.jin
From: Yanjiang Jin Hi, This patch series fix some CAAM compile and runtime warnings. The patches 0001 and 0002 are same as V1. I have tested this on fsl-p5020ds board using upstream 4.0.0-rc1+ with the below configs: CONFIG_DMA_API_DEBUG=y # CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set Ch

Re: [PATCH 0/2] crypto: talitos: Add AES-XTS mode

2015-03-02 Thread Martin Hicks
On Mon, Mar 02, 2015 at 03:37:28PM +0100, Milan Broz wrote: > > If crypto API allows to encrypt more sectors in one run > (handling IV internally) dmcrypt can be modified of course. > > But do not forget we can use another IV (not only sequential number) > e.g. ESSIV with XTS as well (even if it

Re: [PATCH 0/2] crypto: talitos: Add AES-XTS mode

2015-03-02 Thread Martin Hicks
On Mon, Mar 02, 2015 at 04:44:19PM -0500, Martin Hicks wrote: > > Write (MB/s)Read (MB/s) > Unencrypted 140 176 > aes-xts-plain64 512b 113 115 > aes-xts-plain64 4kB 71 56 I got the two AES lines backwards. Sorry about th

Re: [PATCH 0/2] crypto: talitos: Add AES-XTS mode

2015-03-02 Thread Martin Hicks
On Mon, Mar 02, 2015 at 03:25:56PM +0200, Horia Geantă wrote: > On 2/20/2015 7:00 PM, Martin Hicks wrote: > > This adds the AES-XTS mode, supported by the Freescale SEC 3.3.2. > > > > One of the nice things about this hardware is that it knows how to deal > > with encrypt/decrypt requests that are

Re: [PATCH 0/2] crypto: talitos: Add AES-XTS mode

2015-03-02 Thread Milan Broz
On 03/02/2015 02:25 PM, Horia Geantă wrote: > On 2/20/2015 7:00 PM, Martin Hicks wrote: >> This adds the AES-XTS mode, supported by the Freescale SEC 3.3.2. >> >> One of the nice things about this hardware is that it knows how to deal >> with encrypt/decrypt requests that are larger than sector siz

Re: [PATCH 0/2] crypto: talitos: Add AES-XTS mode

2015-03-02 Thread Horia Geantă
On 2/20/2015 7:00 PM, Martin Hicks wrote: > This adds the AES-XTS mode, supported by the Freescale SEC 3.3.2. > > One of the nice things about this hardware is that it knows how to deal > with encrypt/decrypt requests that are larger than sector size, but that > also requires that that the sector

Re: [PATCH 3/4] crypto: caamhash: add two missed dma_mapping_error

2015-03-02 Thread Horia Geantă
On 2/28/2015 8:00 AM, yanjiang@windriver.com wrote: > From: Yanjiang Jin > > Add two missed dma_mapping_error() after dma_map_single(). > > Signed-off-by: Yanjiang Jin > --- > drivers/crypto/caam/caamhash.c | 8 > 1 file changed, 8 insertions(+) > > diff --git a/drivers/crypto/ca

Re: [PATCH 2/4] crypto: caam_rng: fix rng_unmap_ctx's DMA_UNMAP size problem

2015-03-02 Thread Horia Geantă
On 2/28/2015 8:00 AM, yanjiang@windriver.com wrote: > From: Yanjiang Jin > > Fix rng_unmap_ctx's DMA_UNMAP size problem for caam_rng, else system would > report the below calltrace during kexec boot: > > caam_jr ffe301000.jr: DMA-API: device driver frees DMA memory with different > size [de

Re: [PATCH 4/4] crypto: caamhash: replace kmalloc with kzalloc

2015-03-02 Thread Horia Geantă
On 2/28/2015 8:00 AM, yanjiang@windriver.com wrote: > From: Yanjiang Jin > > This can make sure we get a clean memory, else system would report > the below warning: I'd avoid using kzalloc, it's an overhead on the hot path. kmalloc can be used with a bit of attention to detail, i.e. what par

Re: [PATCH 1/4] crypto: caam: fix some compile warnings

2015-03-02 Thread Horia Geantă
On 2/28/2015 8:00 AM, yanjiang@windriver.com wrote: > From: Yanjiang Jin > > This commit is to avoid the below warnings: > > drivers/crypto/caam/sg_sw_sec4.h:88:12: warning: > 'dma_map_sg_chained' defined but not used [-Wunused-function] > static int dma_map_sg_chained(struct device *dev, s

Re: [v1,1/3] crypto: powerpc/sha1 - assembler

2015-03-02 Thread Herbert Xu
On Tue, Feb 24, 2015 at 08:36:40PM +0100, Markus Stockhausen wrote: > This is the assembler code for SHA1 implementation with > the SIMD SPE instruction set. With the enhanced instruction > set we can operate on 2 32 bit words in parallel. That helps > reducing the time to calculate W16-W79. For

Re: [PATCH] ARM: crypto: update NEON AES module to latest OpenSSL version

2015-03-02 Thread Herbert Xu
On Thu, Feb 26, 2015 at 07:22:05AM +, Ard Biesheuvel wrote: > This updates the bit sliced AES module to the latest version in the > upstream OpenSSL repository (e620e5ae37bc). This is needed to fix a > bug in the XTS decryption path, where data chunked in a certain way > could trigger the ciphe

Re: [PATCH] ARM: crypto: update NEON AES module to latest OpenSSL version

2015-03-02 Thread Ard Biesheuvel
On 28 February 2015 at 22:30, Milan Broz wrote: > On 02/26/2015 08:22 AM, Ard Biesheuvel wrote: >> This updates the bit sliced AES module to the latest version in the >> upstream OpenSSL repository (e620e5ae37bc). This is needed to fix a >> bug in the XTS decryption path, where data chunked in a c