Re: [PATCH 01/12] crypto: caam - make sure clocks are enabled first

2019-09-09 Thread Herbert Xu
On Fri, Sep 06, 2019 at 11:18:19AM +, Horia Geanta wrote: > On 9/4/2019 5:35 AM, Andrey Smirnov wrote: > > In order to access IP block's registers we need to enable appropriate > > clocks first, otherwise we are risking hanging the CPU. > > > > The problem becomes very apparent when trying to

Re: [PATCH 01/12] crypto: caam - make sure clocks are enabled first

2019-09-09 Thread Herbert Xu
On Mon, Sep 09, 2019 at 05:21:55PM +1000, Herbert Xu wrote: > On Fri, Sep 06, 2019 at 11:18:19AM +, Horia Geanta wrote: > > On 9/4/2019 5:35 AM, Andrey Smirnov wrote: > > > In order to access IP block's registers we need to enable appropriate > > > clocks first, otherwise we are risking hanging

Re: [PATCH 0/3] crypto: inside-secure - Add support for the CBCMAC

2019-09-09 Thread Herbert Xu
On Wed, Sep 04, 2019 at 09:36:45AM +0200, Pascal van Leeuwen wrote: > This patchset adds support for the (AES) CBCMAC family of authentication > algorithms: AES-CBCMAC, AES-XCBCMAC and AES-MAC > It has been verified with a Xilinx PCIE FPGA board as well as the Marvell > Armada A8K based Macchiatobi

crypto: caam - Cast to long first before pointer conversion

2019-09-09 Thread Herbert Xu
On Tue, Sep 03, 2019 at 07:35:07PM -0700, Andrey Smirnov wrote: > With IRQ requesting being managed by devres we need to make sure that > we dispose of IRQ mapping after and not before it is free'd (otherwise > we'll end up with a warning from the kernel). To achieve that simply > convert IRQ mappi

Re: [PATCH] crypto: arm64: Use PTR_ERR_OR_ZERO rather than its implementation.

2019-09-09 Thread Herbert Xu
On Tue, Sep 03, 2019 at 02:54:16PM +0800, zhong jiang wrote: > PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR. It is better to > use it directly. hence just replace it. > > Signed-off-by: zhong jiang > --- > arch/arm64/crypto/aes-glue.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions

Re: [PATCH v2 00/17] crypto: arm/aes - XTS ciphertext stealing and other updates

2019-09-09 Thread Herbert Xu
On Tue, Sep 03, 2019 at 09:43:22AM -0700, Ard Biesheuvel wrote: > This is a collection of improvements for the ARM and arm64 implementations > of the AES based skciphers. > > NOTES: > - the last two patches add XTS ciphertext stealing test vectors and should > NOT be merged until all AES-XTS imp

Re: [PATCH 00/12] CAAM bugfixes, small improvements

2019-09-09 Thread Herbert Xu
On Tue, Sep 03, 2019 at 07:35:03PM -0700, Andrey Smirnov wrote: > Everyone: > > This series bugfixes and small improvement I made while doing more > testing of CAAM code: > > - "crypto: caam - make sure clocks are enabled first" > >fixes a recent regression (and, conincidentally a leak caus

Re: [PATCH] crypto: cavium/zip - Add missing single_release()

2019-09-09 Thread Herbert Xu
On Wed, Sep 04, 2019 at 02:18:09PM +, Wei Yongjun wrote: > When using single_open() for opening, single_release() should be > used instead of seq_release(), otherwise there is a memory leak. > > Fixes: 09ae5d37e093 ("crypto: zip - Add Compression/Decompression statistics") > Signed-off-by: Wei

Re: [PATCH 1/3] crypto: marvell: Use kzfree rather than its implementation

2019-09-09 Thread Herbert Xu
On Wed, Sep 04, 2019 at 11:01:17AM +0800, zhong jiang wrote: > Use kzfree instead of memset() + kfree(). > > Signed-off-by: zhong jiang > --- > drivers/crypto/marvell/hash.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http:

Re: [PATCH] random: Use wait_event_freezable() in add_hwgenerator_randomness()

2019-09-09 Thread Herbert Xu
On Thu, Sep 05, 2019 at 09:41:12AM -0700, Stephen Boyd wrote: > Sebastian reports that after commit ff296293b353 ("random: Support freezable > kthreads in add_hwgenerator_randomness()") we can call might_sleep() when the > task state is TASK_INTERRUPTIBLE (state=1). This leads to the following > w

Re: [PATCH] crypto: x86/aes-ni - use AES library instead of single-use AES cipher

2019-09-09 Thread Herbert Xu
On Wed, Sep 04, 2019 at 10:56:32AM -0700, Ard Biesheuvel wrote: > The RFC4106 key derivation code instantiates an AES cipher transform > to encrypt only a single block before it is freed again. Switch to > the new AES library which is more suitable for such use cases. > > Signed-off-by: Ard Bieshe

RE: [PATCH 0/3] crypto: inside-secure - Add support for the CBCMAC

2019-09-09 Thread Pascal Van Leeuwen
> -Original Message- > From: linux-crypto-ow...@vger.kernel.org > On Behalf > Of Herbert Xu > Sent: Monday, September 9, 2019 9:38 AM > To: Pascal van Leeuwen > Cc: linux-crypto@vger.kernel.org; antoine.ten...@bootlin.com; > da...@davemloft.net; > Pascal Van Leeuwen > Subject: Re: [PAT

RE: [PATCH 0/3] crypto: inside-secure - Add support for the CBCMAC

2019-09-09 Thread Pascal Van Leeuwen
> -Original Message- > From: linux-crypto-ow...@vger.kernel.org > On Behalf > Of Pascal Van Leeuwen > Sent: Monday, September 9, 2019 12:38 PM > To: Herbert Xu ; Pascal van Leeuwen > > Cc: linux-crypto@vger.kernel.org; antoine.ten...@bootlin.com; > da...@davemloft.net > Subject: RE: [P

Re: crypto: caam - Cast to long first before pointer conversion

2019-09-09 Thread Horia Geanta
On 9/9/2019 10:46 AM, Herbert Xu wrote: > On Tue, Sep 03, 2019 at 07:35:07PM -0700, Andrey Smirnov wrote: >> With IRQ requesting being managed by devres we need to make sure that >> we dispose of IRQ mapping after and not before it is free'd (otherwise >> we'll end up with a warning from the kernel

Re: [PATCH 0/3] crypto: inside-secure - Add support for the CBCMAC

2019-09-09 Thread Herbert Xu
On Mon, Sep 09, 2019 at 10:50:12AM +, Pascal Van Leeuwen wrote: > > So my suggestion would be to supply the CRC32 patch and > then resubmit this patchset unmodified. Would that be OK? That's fine. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://g

Re: [PATCH 2/9] crypto: Add Allwinner sun8i-ce Crypto Engine

2019-09-09 Thread Maxime Ripard
On Sat, Sep 07, 2019 at 09:04:08PM +0200, Corentin Labbe wrote: > > Also, I'm not sure what is the point of having the clocks names be > > parameters there as well. It's constant across all the compatibles, > > the only thing that isn't is the number of clocks and the module clock > > rate. It's wh

[cryptodev:master 288/301] drivers/crypto//caam/jr.c:491:22: warning: cast from pointer to integer of different size

2019-09-09 Thread kbuild test robot
tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master head: 78a1bc18c8ea2bf8bffa007f62c1e471c543d669 commit: 649021ce0f08ac0c19535ef48821fefedfbddd7e [288/301] crypto: caam - dispose of IRQ mapping only after IRQ is freed config: arm64-allyesconfig (

Re: [PATCH 00/12] CAAM bugfixes, small improvements

2019-09-09 Thread Horia Geanta
On 9/9/2019 10:53 AM, Herbert Xu wrote: > On Tue, Sep 03, 2019 at 07:35:03PM -0700, Andrey Smirnov wrote: >> Everyone: >> >> This series bugfixes and small improvement I made while doing more >> testing of CAAM code: >> >> - "crypto: caam - make sure clocks are enabled first" >> >>fixes a rece

[PATCH] crypto: inside-secure - Added support for CRC32

2019-09-09 Thread Pascal van Leeuwen
This patch adds support for the CRC32 "hash" algorithm Signed-off-by: Pascal van Leeuwen --- drivers/crypto/inside-secure/safexcel.c | 1 + drivers/crypto/inside-secure/safexcel.h | 2 + drivers/crypto/inside-secure/safexcel_hash.c | 115 +-- 3 files changed

[PATCH 0/3] crypto: inside-secure - Add support for the CBCMAC

2019-09-09 Thread Pascal van Leeuwen
This patchset adds support for the (AES) CBCMAC family of authentication algorithms: AES-CBCMAC, AES-XCBCMAC and AES-MAC It has been verified with a Xilinx PCIE FPGA board as well as the Marvell Armada A8K based Macchiatobin development board. Pascal van Leeuwen (3): crypto: inside-secure - Adde

[PATCH 2/3] crypto: inside-secure - Added support for the AES XCBC ahash

2019-09-09 Thread Pascal van Leeuwen
This patch adds support for the AES XCBC authentication algorithm Signed-off-by: Pascal van Leeuwen --- drivers/crypto/inside-secure/safexcel.c | 1 + drivers/crypto/inside-secure/safexcel.h | 1 + drivers/crypto/inside-secure/safexcel_hash.c | 136 ++- 3 fi

[PATCH 3/3] crypto: inside-secure - Added support for the AES-CMAC ahash

2019-09-09 Thread Pascal van Leeuwen
This patch adds support for the AES-CMAC authentication algorithm. Signed-off-by: Pascal van Leeuwen --- drivers/crypto/inside-secure/safexcel.c | 1 + drivers/crypto/inside-secure/safexcel.h | 1 + drivers/crypto/inside-secure/safexcel_hash.c | 99 3 fil

[PATCH 1/3] crypto: inside-secure - Added support for the AES CBCMAC ahash

2019-09-09 Thread Pascal van Leeuwen
This patch adds support for the AES-CBCMAC authentication algorithm. Signed-off-by: Pascal van Leeuwen --- drivers/crypto/inside-secure/safexcel.c | 1 + drivers/crypto/inside-secure/safexcel.h | 1 + drivers/crypto/inside-secure/safexcel_hash.c | 235 ++- 3

[PATCH v6 00/12] add integrity and security to TPM2 transactions

2019-09-09 Thread James Bottomley
Link to previous cover letter: https://lore.kernel.org/linux-integrity/1540193596.3202.7.ca...@hansenpartnership.com/ This is marked v6 instead of v5 because I did a v5 after feedback on v4 but didn't get around to posting it and then had to rework the whole of the kernel space handling while I w

[PATCH v6 01/12] tpm-buf: move from static inlines to real functions

2019-09-09 Thread James Bottomley
This separates out the old tpm_buf_... handling functions from static inlines in tpm.h and makes them their own tpm-buf.c file. This is a precursor so we can add new functions for other TPM type handling Signed-off-by: James Bottomley --- v2: added this patch to separate out the API changes v3

[PATCH v6 02/12] tpm-buf: add handling for TPM2B types

2019-09-09 Thread James Bottomley
Most complex TPM commands require appending TPM2B buffers to the command body. Since TPM2B types are essentially variable size arrays, it makes it impossible to represent these complex command arguments as structures and we simply have to build them up using append primitives like these. Signed-o

[PATCH v6 03/12] tpm-buf: add cursor based functions for response parsing

2019-09-09 Thread James Bottomley
It's very convenient when parsing responses to have a cursor you simply move over the response extracting the data. Add such cursor functions for the TPM unsigned integer types. Signed-off-by: James Bottomley --- drivers/char/tpm/tpm-buf.c | 26 ++ drivers/char/tpm/tpm.h

Re: [PATCH] crypto: ccree - enable CTS support in AES-XTS

2019-09-09 Thread Ard Biesheuvel
On Sun, 8 Sep 2019 at 09:04, Uri Shir wrote: > > In XTS encryption/decryption the plaintext byte size > can be >= AES_BLOCK_SIZE. This patch enable the AES-XTS ciphertext > stealing implementation in ccree driver. > > Signed-off-by: Uri Shir > --- > drivers/crypto/ccree/cc_cipher.c | 16 ++--

[PATCH v6 04/12] tpm2-space: export the context save and load commands

2019-09-09 Thread James Bottomley
The TPM2 session handling code needs to save and restore a single volatile context for the elliptic curve version of the NULL seed, so export the APIs which do this for internal use. Signed-off-by: James Bottomley --- drivers/char/tpm/tpm.h| 4 drivers/char/tpm/tpm2-space.c | 8

[PATCH v6 05/12] tpm2-sessions: Add full HMAC and encrypt/decrypt session handling

2019-09-09 Thread James Bottomley
This code adds true session based HMAC authentication plus parameter decryption and response encryption using AES. The basic design of this code is to segregate all the nasty crypto, hash and hmac code into tpm2-sessions.c and export a usable API. The API first of all starts off by gaining a sess

[PATCH v6 06/12] tpm-buf: add tpm_buf_parameters()

2019-09-09 Thread James Bottomley
Introducing encryption sessions changes where the return parameters are located in the buffer because if a return session is present they're 4 bytes beyond the header with those 4 bytes showing the parameter length. If there is no return session, then they're in the usual place immediately after t

[PATCH v6 07/12] tpm2: add hmac checks to tpm2_pcr_extend()

2019-09-09 Thread James Bottomley
We use tpm2_pcr_extend() in trusted keys to extend a PCR to prevent a key from being re-loaded until the next reboot. To use this functionality securely, that extend must be protected by a session hmac. Signed-off-by: James Bottomley --- v3: add error handling to sessions --- drivers/char/tpm

RE: [PATCH 0/3] crypto: inside-secure - Add support for the CBCMAC

2019-09-09 Thread Pascal Van Leeuwen
> -Original Message- > From: linux-crypto-ow...@vger.kernel.org > On Behalf > Of Herbert Xu > Sent: Monday, September 9, 2019 1:35 PM > To: Pascal Van Leeuwen > Cc: Pascal van Leeuwen ; linux-crypto@vger.kernel.org; > antoine.ten...@bootlin.com; da...@davemloft.net > Subject: Re: [PATCH

[PATCH v6 08/12] tpm2: add session encryption protection to tpm2_get_random()

2019-09-09 Thread James Bottomley
If some entity is snooping the TPM bus, they can see the random numbers we're extracting from the TPM and do prediction attacks against their consumers. Foil this attack by using response encryption to prevent the attacker from seeing the random sequence. Signed-off-by: James Bottomley --- v3:

[PATCH v6 09/12] trusted keys: Add session encryption protection to the seal/unseal path

2019-09-09 Thread James Bottomley
If some entity is snooping the TPM bus, the can see the data going in to be sealed and the data coming out as it is unsealed. Add parameter and response encryption to these cases to ensure that no secrets are leaked even if the bus is snooped. As part of doing this conversion it was discovered th

[PATCH v6 10/12] tpm: add the null key name as a tpm2 sysfs variable

2019-09-09 Thread James Bottomley
This is the last component of encrypted tpm2 session handling that allows us to verify from userspace that the key derived from the NULL seed genuinely belongs to the TPM and has not been spoofed. The procedure for doing this involves creating an attestation identity key (which requires verificati

[PATCH v6 11/12] Documentation: add tpm-security.rst

2019-09-09 Thread James Bottomley
Document how the new encrypted secure interface for TPM2 works and how security can be assured after boot by certifying the NULL seed. Signed-off-by: James Bottomley --- v6: replace kernel space with null seed context save --- Documentation/security/tpm/tpm-security.rst | 204 +

[PATCH v6 12/12] tpm2-sessions: NOT FOR COMMITTING add sessions testing

2019-09-09 Thread James Bottomley
This runs through a preset sequence using sessions to demonstrate that the session handling code functions. It does both HMAC, encryption and decryption by testing an encrypted sealing operation with authority and proving that the same sealed data comes back again via an HMAC and response encrypti

Re: [PATCH] crypto: ccree - enable CTS support in AES-XTS

2019-09-09 Thread Gilad Ben-Yossef
On Mon, Sep 9, 2019 at 3:20 PM Ard Biesheuvel wrote: > > On Sun, 8 Sep 2019 at 09:04, Uri Shir wrote: > > > > In XTS encryption/decryption the plaintext byte size > > can be >= AES_BLOCK_SIZE. This patch enable the AES-XTS ciphertext > > stealing implementation in ccree driver. > > > > Signed-off

[PATCH v2 2/2] hwrng: npcm: add NPCM RNG driver

2019-09-09 Thread Tomer Maimon
Add Nuvoton NPCM BMC Random Number Generator(RNG) driver. Signed-off-by: Tomer Maimon --- drivers/char/hw_random/Kconfig| 13 ++ drivers/char/hw_random/Makefile | 1 + drivers/char/hw_random/npcm-rng.c | 203 ++ 3 files changed, 217 insertions(+) create mode

[PATCH v2 1/2] dt-binding: hwrng: add NPCM RNG documentation

2019-09-09 Thread Tomer Maimon
Added device tree binding documentation for Nuvoton BMC NPCM Random Number Generator (RNG). Signed-off-by: Tomer Maimon --- .../bindings/rng/nuvoton,npcm-rng.txt | 17 + 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/rng/nuvoton,n

[PATCH v2 0/2] hwrng: npcm: add NPCM RNG driver support

2019-09-09 Thread Tomer Maimon
This patch set adds Randon Number Generator (RNG) support for the Nuvoton NPCM Baseboard Management Controller (BMC). The RNG driver we use power consumption when the RNG is not required. The NPCM RNG driver tested on NPCM750 evaluation board. Addressed comments from:. - Daniel Thompson, Milt

Re: [PATCH 00/12] CAAM bugfixes, small improvements

2019-09-09 Thread Herbert Xu
On Mon, Sep 09, 2019 at 12:07:17PM +, Horia Geanta wrote: > > Why all? > I've ack-ed only 1 and 4. > > Besides this, patches 11 and/or 12 break the functionality, > i.e. driver gets stuck during crypto self-tests. Should I back out 5-12 or everything but patch 1? Patch 4 can't be applied wit

Re: [PATCH 02/12] crypto: caam - use devres to unmap JR's registers

2019-09-09 Thread Horia Geanta
On 9/4/2019 5:35 AM, Andrey Smirnov wrote: > Use devres to unmap memory and drop explicit de-initialization > code. > > NOTE: There's no corresponding unmapping code in caam_jr_remove which > seems like a resource leak. > > Signed-off-by: Andrey Smirnov > Cc: Chris Healy > Cc: Lucas Stach > Cc

Re: [PATCH 2/9] crypto: Add Allwinner sun8i-ce Crypto Engine

2019-09-09 Thread Corentin Labbe
On Mon, Sep 09, 2019 at 01:38:37PM +0200, Maxime Ripard wrote: > On Sat, Sep 07, 2019 at 09:04:08PM +0200, Corentin Labbe wrote: > > > Also, I'm not sure what is the point of having the clocks names be > > > parameters there as well. It's constant across all the compatibles, > > > the only thing th

Re: [PATCH 05/12] crypto: caam - use devres to unmap memory

2019-09-09 Thread Horia Geanta
On 9/4/2019 5:35 AM, Andrey Smirnov wrote: > Use devres to unmap memory and drop corresponding iounmap() call. > > Signed-off-by: Andrey Smirnov > Cc: Chris Healy > Cc: Lucas Stach > Cc: Horia Geantă > Cc: Herbert Xu > Cc: Iuliana Prodan > Cc: linux-crypto@vger.kernel.org > Cc: linux-ker...@

Re: [PATCH 06/12] crypto: caam - use devres to remove debugfs

2019-09-09 Thread Horia Geanta
On 9/4/2019 5:35 AM, Andrey Smirnov wrote: > Use devres to remove debugfs and drop corresponding > debugfs_remove_recursive() call. > > Signed-off-by: Andrey Smirnov > Cc: Chris Healy > Cc: Lucas Stach > Cc: Horia Geantă > Cc: Herbert Xu > Cc: Iuliana Prodan > Cc: linux-crypto@vger.kernel.or

Re: [PATCH 00/12] CAAM bugfixes, small improvements

2019-09-09 Thread Horia Geanta
On 9/9/2019 3:52 PM, Herbert Xu wrote: > On Mon, Sep 09, 2019 at 12:07:17PM +, Horia Geanta wrote: >> >> Why all? >> I've ack-ed only 1 and 4. >> >> Besides this, patches 11 and/or 12 break the functionality, >> i.e. driver gets stuck during crypto self-tests. > > Should I back out 5-12 or eve

Re: [PATCH 00/12] CAAM bugfixes, small improvements

2019-09-09 Thread Herbert Xu
On Mon, Sep 09, 2019 at 01:26:31PM +, Horia Geanta wrote: > > Let's go with patches 1-4, and revert 5-12. OK, done and pushed out. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[v2 PATCH] crypto: caam - Cast to long first before pointer conversion

2019-09-09 Thread Herbert Xu
While storing an int in a pointer is safe the compiler is not happy about it. So we need some extra casting in order to make this warning free. Fixes: 1d3f75bce123 ("crypto: caam - dispose of IRQ mapping only...") Signed-off-by: Herbert Xu Reviewed-by: Horia Geantă diff --git a/drivers/crypto/

Re: [PATCH 2/9] crypto: Add Allwinner sun8i-ce Crypto Engine

2019-09-09 Thread Maxime Ripard
On Mon, Sep 09, 2019 at 03:19:06PM +0200, Corentin Labbe wrote: > On Mon, Sep 09, 2019 at 01:38:37PM +0200, Maxime Ripard wrote: > > On Sat, Sep 07, 2019 at 09:04:08PM +0200, Corentin Labbe wrote: > > > > Also, I'm not sure what is the point of having the clocks names be > > > > parameters there as

Re: [PATCH] crypto: ccree - enable CTS support in AES-XTS

2019-09-09 Thread Ard Biesheuvel
On Mon, 9 Sep 2019 at 13:34, Gilad Ben-Yossef wrote: > > On Mon, Sep 9, 2019 at 3:20 PM Ard Biesheuvel > wrote: > > > > On Sun, 8 Sep 2019 at 09:04, Uri Shir wrote: > > > > > > In XTS encryption/decryption the plaintext byte size > > > can be >= AES_BLOCK_SIZE. This patch enable the AES-XTS cip

Re: [PATCH v1 2/2] hwrng: npcm: add NPCM RNG driver

2019-09-09 Thread Daniel Thompson
On Mon, Sep 09, 2019 at 05:31:30PM +0300, Tomer Maimon wrote: > Hi Daniel, > > appreciate your comments and sorry for the late reply > > On Thu, 29 Aug 2019 at 13:47, Daniel Thompson > wrote: > > > On Wed, Aug 28, 2019 at 07:26:17PM +0300, Tomer Maimon wrote: > > > Add Nuvoton NPCM BMC Random N

Re: [PATCH] crypto: ccree - enable CTS support in AES-XTS

2019-09-09 Thread Gilad Ben-Yossef
On Mon, Sep 9, 2019 at 5:38 PM Ard Biesheuvel wrote: > > On Mon, 9 Sep 2019 at 13:34, Gilad Ben-Yossef wrote: > > > > On Mon, Sep 9, 2019 at 3:20 PM Ard Biesheuvel > > wrote: > > > > > > On Sun, 8 Sep 2019 at 09:04, Uri Shir wrote: > > > > > > > > In XTS encryption/decryption the plaintext byt

Re: [PATCH 07/12] crypto: caam - use devres to de-initialize the RNG

2019-09-09 Thread Horia Geanta
On 9/4/2019 5:35 AM, Andrey Smirnov wrote: > Use devres to de-initialize the RNG and drop explicit de-initialization > code in caam_remove(). > > Signed-off-by: Andrey Smirnov > Cc: Chris Healy > Cc: Lucas Stach > Cc: Horia Geantă > Cc: Herbert Xu > Cc: Iuliana Prodan > Cc: linux-crypto@vger

Re: [PATCH] crypto: ccree - enable CTS support in AES-XTS

2019-09-09 Thread Herbert Xu
On Mon, Sep 09, 2019 at 03:38:02PM +0100, Ard Biesheuvel wrote: > > The blocksize is primarily used by the walking code to ensure that the > input is a round multiple. In the XTS case, we can't blindly use the > skcipher walk interface to go over the data anyway, since the last > full block needs s

[PATCH] crypto: algif_skcipher - Use chunksize instead of blocksize

2019-09-09 Thread Herbert Xu
When algif_skcipher does a partial operation it always process data that is a multiple of blocksize. However, for algorithms such as CTR this is wrong because even though it can process any number of bytes overall, the partial block must come at the very end and not in the middle. This is exactly

[PATCH] crypto: talitos - fix hash result for VMAP_STACK

2019-09-09 Thread Christophe Leroy
When VMAP_STACK is selected, stack cannot be DMA-mapped. Therefore, the hash result has to be DMA-mapped in the request context and copied into areq->result at completion. Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) dif

Re: [PATCH] crypto: talitos - fix missing break in switch statement

2019-09-09 Thread Christophe Leroy
Le 09/09/2019 à 07:29, Gustavo A. R. Silva a écrit : Add missing break statement in order to prevent the code from falling through to case CRYPTO_ALG_TYPE_AHASH. Fixes: aeb4c132f33d ("crypto: talitos - Convert to new AEAD interface") Cc: sta...@vger.kernel.org Reported-by: kbuild test robot