RE: [PATCH 3/3] crypto: inside-secure - add support for using the EIP197 without firmware images

2019-06-24 Thread Pascal Van Leeuwen
> -Original Message- > From: Herbert Xu > Sent: Monday, June 24, 2019 4:20 PM > To: Antoine Tenart > Cc: Pascal Van Leeuwen ; Pascal van Leeuwen > ; linux- > cry...@vger.kernel.org; da...@davemloft.net > Subject: Re: [PATCH 3/3] crypto: inside-secure - add support for using the > EIP197

Re: [PATCH v2] airo: switch to skcipher interface

2019-06-24 Thread Kalle Valo
Ard Biesheuvel wrote: > The AIRO driver applies a ctr(aes) on a buffer of considerable size > (2400 bytes), and instead of invoking the crypto API to handle this > in its entirety, it open codes the counter manipulation and invokes > the AES block cipher directly. > > Let's fix this, by switchin

Re: [PATCH v4 1/4] lib/scatterlist: Fix mapping iterator when sg->offset is greater than PAGE_SIZE

2019-06-24 Thread Herbert Xu
On Mon, Jun 24, 2019 at 08:35:33PM +0300, Imre Deak wrote: > Hi, > > On Thu, Jun 20, 2019 at 02:02:21PM +0800, Herbert Xu wrote: > > On Mon, Jun 17, 2019 at 09:15:02PM +, Christophe Leroy wrote: > > > All mapping iterator logic is based on the assumption that sg->offset > > > is always lower t

Re: [PATCH 10/11] crypto: ccp - Add a module parameter to control registration for DMA

2019-06-24 Thread Lendacky, Thomas
On 6/24/19 2:29 PM, Hook, Gary wrote: > The CCP driver is able to act as a DMA engine. Add a module parameter that > allows this feature to be enabled/disabled. > > Signed-off-by: Gary R Hook > --- > drivers/crypto/ccp/ccp-dev-v5.c | 11 +++ > drivers/crypto/ccp/ccp-dev.h|1 + >

Re: [PATCH 08/11] crypto: ccp - module parameter to allow CCP selection by PCI bus

2019-06-24 Thread Lendacky, Thomas
On 6/24/19 2:29 PM, Hook, Gary wrote: > Add a module parameter that allows specification of one or more CCPs > based on PCI bus identifiers. The value of the parameter is a comma- > separated list of bus numbers, in no particular order. > > Signed-off-by: Gary R Hook > --- > drivers/crypto/ccp/s

Re: [PATCH 06/11] crypto: ccp - Specify a single CCP via PCI device ID

2019-06-24 Thread Lendacky, Thomas
On 6/24/19 2:29 PM, Hook, Gary wrote: > Some processors contain multiple CCPs with differing device IDs. Enable > the selection of specific devices based on ID. The parameter value is > a single PCI ID. > > Signed-off-by: Gary R Hook > --- > drivers/crypto/ccp/sp-pci.c |7 +++ > 1 file c

Re: [PATCH 0/3] Clean up crypto documentation

2019-06-24 Thread Joe Perches
On Mon, 2019-06-24 at 14:37 -0600, Jonathan Corbet wrote: > On Mon, 24 Jun 2019 13:29:42 -0700 > Joe Perches wrote: > > > > Finally, would you prefer a v2 of the patch set? Happy to do > > > whatever is preferred, of course. > > > > Whatever Jonathan decides is fine with me. > > Mine was just

Re: [PATCH 04/11] crypto: ccp - module parameter to limit the number of enabled CCPs

2019-06-24 Thread Lendacky, Thomas
On 6/24/19 2:28 PM, Hook, Gary wrote: > Provide the ability to constrain the total number of enabled devices in > the system. Once maxdev devices have been configured, additional > devices are ignored. > > Signed-off-by: Gary R Hook > --- > drivers/crypto/ccp/sp-pci.c | 16 >

Re: [PATCH 2/3] crypto: doc - Describe the crypto engine

2019-06-24 Thread Eric Biggers
On Mon, Jun 24, 2019 at 07:07:49PM +, Hook, Gary wrote: > Add a reference to the crypto engine documentation to > the index. > > Signed-off-by: Gary R Hook > --- > Documentation/crypto/index.rst |1 + > 1 file changed, 1 insertion(+) > > diff --git a/Documentation/crypto/index.rst b/Doc

Re: [PATCH 03/11] crypto: ccp - Expose the value of nqueues in DebugFS

2019-06-24 Thread Lendacky, Thomas
On 6/24/19 2:28 PM, Hook, Gary wrote: > Make module parameters readable in DebugFS. Not sure why you have this... you can access the module parameters in /sys/module/ccp/parameters. You can then get/set them based on the value in the module_param() definition. Thanks, Tom > > Signed-off-by: Ga

Re: [PATCH 02/11] crypto: ccp - Add a module parameter to specify a queue count

2019-06-24 Thread Lendacky, Thomas
On 6/24/19 2:28 PM, Hook, Gary wrote: > Add a module parameter to limit the number of queues per CCP. The default > (nqueues=0) is to set up every available queue on each device. This doesn't match the code... nqueues defaults to MAX_HW_QUEUES below. The way it is coded nqueues=0 and nqueues=1 ar

Re: lib/mpi: Fix karactx leak in mpi_powm

2019-06-24 Thread Eric Biggers
On Mon, Jun 24, 2019 at 06:32:26PM +0800, Herbert Xu wrote: > On Mon, Jun 24, 2019 at 12:27:08AM -0700, syzbot wrote: > > Hello, > > > > syzbot found the following crash on: > > > > HEAD commit:abf02e29 Merge tag 'pm-5.2-rc6' of git://git.kernel.org/pu.. > > git tree: upstream > > conso

Re: [PATCH 0/3] Clean up crypto documentation

2019-06-24 Thread Jonathan Corbet
On Mon, 24 Jun 2019 13:29:42 -0700 Joe Perches wrote: > > Finally, would you prefer a v2 of the patch set? Happy to do > > whatever is preferred, of course. > > Whatever Jonathan decides is fine with me. > Mine was just a plea to avoid unnecessarily > making the source text harder to read as >

Re: [PATCH 0/3] Clean up crypto documentation

2019-06-24 Thread Joe Perches
On Mon, 2019-06-24 at 20:06 +, Gary R Hook wrote: Hi Gary. > On 6/24/19 2:30 PM, Joe Perches wrote: > > On Mon, 2019-06-24 at 19:07 +, Hook, Gary wrote: > > > Tidy up the crypto documentation by filling in some variable > > > descriptions, make some grammatical corrections, and enhance >

Re: [PATCH 0/3] Clean up crypto documentation

2019-06-24 Thread Gary R Hook
On 6/24/19 2:30 PM, Joe Perches wrote: > On Mon, 2019-06-24 at 19:07 +, Hook, Gary wrote: >> Tidy up the crypto documentation by filling in some variable >> descriptions, make some grammatical corrections, and enhance >> formatting. > > While this seems generally OK, please try not to make the

Re: [PATCH v11 02/13] PKCS#7: Refactor verify_pkcs7_signature()

2019-06-24 Thread Thiago Jung Bauermann
Hello David, AFAIK Mimi is happy with this patch set, but I still need acks from maintainers of other subsystems that my changes touch before she can accept it. Are this patch and the next one ("PKCS#7: Introduce pkcs7_get_digest()") OK from your PoV? -- Thiago Jung Bauermann IBM Linux Technol

Re: [PATCH v11 01/13] MODSIGN: Export module signature definitions

2019-06-24 Thread Thiago Jung Bauermann
Hello Jessica, AFAIK Mimi is happy with this patch set, but I still need acks from maintainers of other subsystems that my changes touch before she can accept it. Is this patch OK from your PoV? -- Thiago Jung Bauermann IBM Linux Technology Center Thiago Jung Bauermann writes: > IMA will u

[PATCH 09/11] crypto: ccp - expose pcibus module parameter in debugfs

2019-06-24 Thread Hook, Gary
Add module parameter pcibus as a read-only variable to the CCP's debugfs info. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-debugfs.c |1 + drivers/crypto/ccp/ccp-dev.h |1 + drivers/crypto/ccp/sp-pci.c | 47 -- 3 files changed, 47

Re: [PATCH 0/3] Clean up crypto documentation

2019-06-24 Thread Joe Perches
On Mon, 2019-06-24 at 19:07 +, Hook, Gary wrote: > Tidy up the crypto documentation by filling in some variable > descriptions, make some grammatical corrections, and enhance > formatting. While this seems generally OK, please try not to make the readability of the source _text_ less intelligi

[PATCH 08/11] crypto: ccp - module parameter to allow CCP selection by PCI bus

2019-06-24 Thread Hook, Gary
Add a module parameter that allows specification of one or more CCPs based on PCI bus identifiers. The value of the parameter is a comma- separated list of bus numbers, in no particular order. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/sp-pci.c | 58 +

[PATCH 11/11] crypto: ccp - Expose the registerdma module parameter in DFS

2019-06-24 Thread Hook, Gary
Add a read-only variable to report the value of the parameter Signed-off-by: Gary R Hook --- drivers/crypto/ccp/sp-pci.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/ccp/sp-pci.c b/drivers/crypto/ccp/sp-pci.c index 5b0a9c145c5a..c1c1e05a7c0f 100644 --- a/drivers/crypto/c

[PATCH 10/11] crypto: ccp - Add a module parameter to control registration for DMA

2019-06-24 Thread Hook, Gary
The CCP driver is able to act as a DMA engine. Add a module parameter that allows this feature to be enabled/disabled. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v5.c | 11 +++ drivers/crypto/ccp/ccp-dev.h|1 + drivers/crypto/ccp/sp-pci.c |8 3 f

[PATCH 04/11] crypto: ccp - module parameter to limit the number of enabled CCPs

2019-06-24 Thread Hook, Gary
Provide the ability to constrain the total number of enabled devices in the system. Once maxdev devices have been configured, additional devices are ignored. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/sp-pci.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers

[PATCH 05/11] crypto: ccp - Expose maxdev through DebugFS

2019-06-24 Thread Hook, Gary
Add a read-only debugfs entry for the module parameter 'maxdev'. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/sp-pci.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/ccp/sp-pci.c b/drivers/crypto/ccp/sp-pci.c index b81493810689..29177d113c90 100644 --- a/drivers/crypt

[PATCH 06/11] crypto: ccp - Specify a single CCP via PCI device ID

2019-06-24 Thread Hook, Gary
Some processors contain multiple CCPs with differing device IDs. Enable the selection of specific devices based on ID. The parameter value is a single PCI ID. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/sp-pci.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/crypto/c

[PATCH 07/11] crypto: ccp - expose the pcidev module parameter in debugfs

2019-06-24 Thread Hook, Gary
Add pcidev to the CCP's debugfs information Signed-off-by: Gary R Hook --- drivers/crypto/ccp/sp-pci.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/ccp/sp-pci.c b/drivers/crypto/ccp/sp-pci.c index b024b92fb749..bcd1e233dce7 100644 --- a/drivers/crypto/ccp/sp-pci.c +++ b/

[PATCH 02/11] crypto: ccp - Add a module parameter to specify a queue count

2019-06-24 Thread Hook, Gary
Add a module parameter to limit the number of queues per CCP. The default (nqueues=0) is to set up every available queue on each device. The count of queues starts from the first one found on the device (which is based on the device ID). Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev

[PATCH 03/11] crypto: ccp - Expose the value of nqueues in DebugFS

2019-06-24 Thread Hook, Gary
Make module parameters readable in DebugFS. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-debugfs.c |2 ++ drivers/crypto/ccp/sp-pci.c | 22 ++ 2 files changed, 24 insertions(+) diff --git a/drivers/crypto/ccp/ccp-debugfs.c b/drivers/crypto/ccp/ccp-debugfs

[PATCH 01/11] crypto: ccp - Make CCP debugfs support optional

2019-06-24 Thread Hook, Gary
Add a config option to exclude DebugFS support in the CCP driver. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/Kconfig |9 + drivers/crypto/ccp/Makefile |4 ++-- drivers/crypto/ccp/ccp-dev-v5.c |4 3 files changed, 15 insertions(+), 2 deletions(-) diff --g

[PATCH 00/11] Add module parameters to control CCP activation

2019-06-24 Thread Hook, Gary
Firstly, add a switch to allow/disallow debugfs code to be built into the CCP driver. This rest of the patch series implements a set of module parameters that allow fine-tuned control over which CCPs on a system are enabled by the driver, and how many queues on each device are activated. Lastly,

[PATCH 3/3] crypto: doc - Fix formatting of new crypto engine content

2019-06-24 Thread Hook, Gary
Tidy up the formatting/grammar in crypto_engine.rst. Use lists where appropriate. Signed-off-by: Gary R Hook --- Documentation/crypto/crypto_engine.rst | 120 ++-- 1 file changed, 82 insertions(+), 38 deletions(-) diff --git a/Documentation/crypto/crypto_engine.rst

[PATCH 1/3] crypto: doc - Add parameter documentation

2019-06-24 Thread Hook, Gary
Fill in missing parameter descriptions for the ompression algorithm, then pick them up to document for the compression_alg structure. Signed-off-by: Gary R Hook --- Documentation/crypto/api-skcipher.rst |2 +- include/linux/crypto.h| 11 +++ 2 files changed, 12 inse

[PATCH 2/3] crypto: doc - Describe the crypto engine

2019-06-24 Thread Hook, Gary
Add a reference to the crypto engine documentation to the index. Signed-off-by: Gary R Hook --- Documentation/crypto/index.rst |1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/crypto/index.rst b/Documentation/crypto/index.rst index c4ff5d791233..37cd7fb0ea82 100644 --- a/Docu

[PATCH 0/3] Clean up crypto documentation

2019-06-24 Thread Hook, Gary
Tidy up the crypto documentation by filling in some variable descriptions, make some grammatical corrections, and enhance formatting. --- Gary R Hook (3): crypto: doc - Add parameter documentation crypto: doc - Describe the crypto engine crypto: doc - Fix formatting of new crypt

[PATCH 1/2] crypto: arm64/aes-ce - add 5 way interleave routines

2019-06-24 Thread Ard Biesheuvel
In preparation of tweaking the accelerated AES chaining mode routines to be able to use a 5-way stride, implement the core routines to support processing 5 blocks of input at a time. While at it, drop the 2 way versions, which have been unused for a while now. Signed-off-by: Ard Biesheuvel --- a

[PATCH 0/2] crypto: arm64/aes-ce - implement 5-way interleave for some modes

2019-06-24 Thread Ard Biesheuvel
As it turns out, even a 4-way interleave is not sufficient to saturate the ThunderX2 pipeline with AES instructions, so this series implements 5-way interleave for modes that can be modified without running out of registers to maintain chaining mode state across the encryption operation, i.e., ECB,

[PATCH 2/2] crypto: arm64/aes-ce - implement 5 way interleave for ECB, CBC and CTR

2019-06-24 Thread Ard Biesheuvel
This implements 5-way interleaving for ECB, CBC decryption and CTR, resulting in a speedup of ~11% on Marvell ThunderX2, which has a very deep pipeline and therefore a high issue latency for NEON instructions operating on the same registers. Note that XTS is left alone: implementing 5-way interlea

Re: [PATCH v4 1/4] lib/scatterlist: Fix mapping iterator when sg->offset is greater than PAGE_SIZE

2019-06-24 Thread Imre Deak
Hi, On Thu, Jun 20, 2019 at 02:02:21PM +0800, Herbert Xu wrote: > On Mon, Jun 17, 2019 at 09:15:02PM +, Christophe Leroy wrote: > > All mapping iterator logic is based on the assumption that sg->offset > > is always lower than PAGE_SIZE. > > > > But there are situations where sg->offset is su

Re: [PATCH 0/6] crypto: aegis128 - add NEON intrinsics version for ARM/arm64

2019-06-24 Thread Eric Biggers
On Mon, Jun 24, 2019 at 09:38:12AM +0200, Ard Biesheuvel wrote: > Now that aegis128 has been announced as one of the winners of the CAESAR > competition, it's time to provide some better support for it on arm64 (and > 32-bit ARM *) > > This time, instead of cloning the generic driver twice and rew

Re: [patch] crypto: ccp - Free ccp if initialization fails

2019-06-24 Thread Gary R Hook
On 6/24/19 8:04 AM, Lendacky, Thomas wrote: > On 6/23/19 2:18 PM, David Rientjes wrote: >> If ccp_dev_init() fails, kfree() the allocated ccp since it will otherwise >> be leaked. > > Not needed. It's allocated with devm_kzalloc(), so it won't be leaked. > > Thanks, > Tom Nacked-By: Gary R Hook

Re: [PATCH] crypto: qat - Endian bug in interrupt handler

2019-06-24 Thread Dan Carpenter
Never mind. Please ignore this patch. This is Intel hardware so it's little endian. There are a bunch of other test_bit() casts which would be problematic so this wouldn't really fix anything anyway. regards, dan carpenter

Re: [PATCH 5/6] crypto: aegis128 - provide a SIMD implementation based on NEON intrinsics

2019-06-24 Thread Ard Biesheuvel
On Mon, 24 Jun 2019 at 09:38, Ard Biesheuvel wrote: > > Provide an accelerated implementation of aegis128 by wiring up the > SIMD hooks in the generic driver to an implementation based on NEON > intrinsics, which can be compiled to both ARM and arm64 code. > > This results in a performance of 2.2

Re: [PATCH 1/8] tpm: block messages while suspended

2019-06-24 Thread Herbert Xu
On Thu, Jun 20, 2019 at 06:03:17PM -0700, Stephen Boyd wrote: > > What do you think of the attached patch? I haven't tested it, but it > would make sure that the kthread is frozen so that the hardware can be > resumed before the kthread is thawed and tries to go touch the hardware. Looks good to m

Re: [PATCH 3/3] crypto: inside-secure - add support for using the EIP197 without firmware images

2019-06-24 Thread Herbert Xu
On Thu, Jun 20, 2019 at 05:42:59PM +0200, Antoine Tenart wrote: > > Yes, you either have to choice to put it in /lib/firmware (and in the > linux-firmwares project!) or to convince people to allow releasing this. I agree. We should not be adding firmware into the driver itself. Thanks, -- Email

[PATCH] crypto: qat - Endian bug in interrupt handler

2019-06-24 Thread Dan Carpenter
The "vf_mask" as a u32 but we were casting it to unsigned long when we do the for_each_set_bit() loop. The problem is that is an out of bounds read on big endian 64 bit systems. Fixes: ed8ccaef52fa ("crypto: qat - Add support for SRIOV") Signed-off-by: Dan Carpenter --- Not tested. I don't know

[RFC/RFT PATCH] crypto: aes/generic - use unaligned loads to eliminate 50% of lookup tables

2019-06-24 Thread Ard Biesheuvel
The generic table based AES implementation uses 16 KB worth of lookup tables, where 4 base tables of 1 KB each are emitted three additional times with the coefficients rotated by 1, 2 and 3 bytes, respectively. Given that many architectures tolerate unaligned accesses at moderate cost, we can sacr

Re: [patch] crypto: ccp - Free ccp if initialization fails

2019-06-24 Thread Lendacky, Thomas
On 6/23/19 2:18 PM, David Rientjes wrote: > If ccp_dev_init() fails, kfree() the allocated ccp since it will otherwise > be leaked. Not needed. It's allocated with devm_kzalloc(), so it won't be leaked. Thanks, Tom > > Fixes: 720419f01832 ("crypto: ccp - Introduce the AMD Secure Processor > dev

lib/mpi: Fix karactx leak in mpi_powm

2019-06-24 Thread Herbert Xu
On Mon, Jun 24, 2019 at 12:27:08AM -0700, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:abf02e29 Merge tag 'pm-5.2-rc6' of git://git.kernel.org/pu.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=17a8bfeaa0 > kernel

Re: [RFC PATCH 02/30] crypto: s390/des - switch to new verification routines

2019-06-24 Thread Harald Freudenberger
On 22.06.19 02:30, Ard Biesheuvel wrote: > Signed-off-by: Ard Biesheuvel > --- > arch/s390/crypto/des_s390.c | 15 ++- > 1 file changed, 6 insertions(+), 9 deletions(-) > > diff --git a/arch/s390/crypto/des_s390.c b/arch/s390/crypto/des_s390.c > index 1f9ab24dc048..4e4061885b0d 100644

Re: [PATCH 3/6] crypto: aegis - avoid prerotated AES tables

2019-06-24 Thread Ondrej Mosnacek
On Mon, Jun 24, 2019 at 9:38 AM Ard Biesheuvel wrote: > The generic AES code provides four sets of lookup tables, where each > set consists of four tables containing the same 32-bit values, but > rotated by 0, 8, 16 and 24 bits, respectively. This makes sense for > CISC architectures such as x86 w

Re: [PATCH 2/6] crypto: aegis - drop empty TFM init/exit routines

2019-06-24 Thread Ondrej Mosnacek
On Mon, Jun 24, 2019 at 9:38 AM Ard Biesheuvel wrote: > TFM init/exit routines are optional, so no need to provide empty ones. > > Signed-off-by: Ard Biesheuvel Reviewed-by: Ondrej Mosnacek > --- > crypto/aegis128.c | 11 --- > crypto/aegis128l.c | 11 --- > crypto/aegis256.c

Re: [PATCH 1/6] crypto: aegis128 - use unaliged helper in unaligned decrypt path

2019-06-24 Thread Ard Biesheuvel
On Mon, 24 Jun 2019 at 09:59, Ondrej Mosnacek wrote: > > Hi Ard, > > On Mon, Jun 24, 2019 at 9:38 AM Ard Biesheuvel > wrote: > > > > Use crypto_aegis128_update_u() not crypto_aegis128_update_a() in the > > decrypt path that is taken when the source or destination pointers > > are not aligned. > >

Re: [PATCH 1/6] crypto: aegis128 - use unaliged helper in unaligned decrypt path

2019-06-24 Thread Ondrej Mosnacek
Hi Ard, On Mon, Jun 24, 2019 at 9:38 AM Ard Biesheuvel wrote: > > Use crypto_aegis128_update_u() not crypto_aegis128_update_a() in the > decrypt path that is taken when the source or destination pointers > are not aligned. > > Signed-off-by: Ard Biesheuvel > --- > crypto/aegis128.c | 2 +- > 1

[PATCH 1/6] crypto: aegis128 - use unaliged helper in unaligned decrypt path

2019-06-24 Thread Ard Biesheuvel
Use crypto_aegis128_update_u() not crypto_aegis128_update_a() in the decrypt path that is taken when the source or destination pointers are not aligned. Signed-off-by: Ard Biesheuvel --- crypto/aegis128.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/aegis128.c b/cry

[PATCH 4/6] crypto: aegis128 - add support for SIMD acceleration

2019-06-24 Thread Ard Biesheuvel
Add some plumbing to allow the AEGIS128 code to be built with SIMD routines for acceleration. Signed-off-by: Ard Biesheuvel --- crypto/aegis.h| 14 +++ crypto/aegis128.c | 42 ++-- 2 files changed, 45 insertions(+), 11 deletions(-) diff --git a/crypto/aegis.h b/crypto/ae

[PATCH 5/6] crypto: aegis128 - provide a SIMD implementation based on NEON intrinsics

2019-06-24 Thread Ard Biesheuvel
Provide an accelerated implementation of aegis128 by wiring up the SIMD hooks in the generic driver to an implementation based on NEON intrinsics, which can be compiled to both ARM and arm64 code. This results in a performance of 2.2 cycles per byte on Cortex-A53, which is a performance increase o

[PATCH 3/6] crypto: aegis - avoid prerotated AES tables

2019-06-24 Thread Ard Biesheuvel
The generic AES code provides four sets of lookup tables, where each set consists of four tables containing the same 32-bit values, but rotated by 0, 8, 16 and 24 bits, respectively. This makes sense for CISC architectures such as x86 which support memory operands, but for other architectures, the

[PATCH 0/6] crypto: aegis128 - add NEON intrinsics version for ARM/arm64

2019-06-24 Thread Ard Biesheuvel
Now that aegis128 has been announced as one of the winners of the CAESAR competition, it's time to provide some better support for it on arm64 (and 32-bit ARM *) This time, instead of cloning the generic driver twice and rewriting half of it in arm64 and ARM assembly, add hooks for an accelerated

[PATCH 6/6] crypto: tcrypt - add a speed test for AEGIS128

2019-06-24 Thread Ard Biesheuvel
Signed-off-by: Ard Biesheuvel --- crypto/tcrypt.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index ad78ab5b93cb..c578ccd92c57 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -2327,6 +2327,13 @@ static int do_test(const char *alg, u32 type, u

[PATCH 2/6] crypto: aegis - drop empty TFM init/exit routines

2019-06-24 Thread Ard Biesheuvel
TFM init/exit routines are optional, so no need to provide empty ones. Signed-off-by: Ard Biesheuvel --- crypto/aegis128.c | 11 --- crypto/aegis128l.c | 11 --- crypto/aegis256.c | 11 --- 3 files changed, 33 deletions(-) diff --git a/crypto/aegis128.c b/crypto/aegis1

memory leak in mpihelp_mul_karatsuba_case

2019-06-24 Thread syzbot
Hello, syzbot found the following crash on: HEAD commit:abf02e29 Merge tag 'pm-5.2-rc6' of git://git.kernel.org/pu.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=17a8bfeaa0 kernel config: https://syzkaller.appspot.com/x/.config?x=56f1da14935c3cce da

[PATCH v4 2/3] dt-bindings: rng: add bindings for MediaTek ARMv8 SoCs

2019-06-24 Thread Neal Liu
Document the binding used by the MediaTek ARMv8 SoCs random number generator with TrustZone enabled. Signed-off-by: Neal Liu --- .../devicetree/bindings/rng/mtk-sec-rng.txt| 10 ++ 1 file changed, 10 insertions(+) create mode 100644 Documentation/devicetree/bindings/rng/mtk-se

[PATCH v4 1/3] soc: mediatek: add SMC fid table for SIP interface

2019-06-24 Thread Neal Liu
1. Add a header file to provide SIP interface to ATF 2. Add hwrng SMC fid Signed-off-by: Neal Liu --- include/linux/soc/mediatek/mtk_sip_svc.h | 33 ++ 1 file changed, 33 insertions(+) create mode 100644 include/linux/soc/mediatek/mtk_sip_svc.h diff --git a/includ

[PATCH v4 0/3] MediaTek Security random number generator support

2019-06-24 Thread Neal Liu
These patch series introduce a generic rng driver for Trustzone based kernel driver which would like to communicate with ATF SIP services. Patch #1 initials SMC fid table for Mediatek SIP interfaces and adds HWRNG related SMC call. Patch #2..3 adds mtk-sec-rng kernel driver for Trustzone based So

[PATCH v4 3/3] hwrng: add mtk-sec-rng driver

2019-06-24 Thread Neal Liu
For MediaTek SoCs on ARMv8 with TrustZone enabled, peripherals like entropy sources is not accessible from normal world (linux) and rather accessible from secure world (ATF/TEE) only. This driver aims to provide a generic interface to ATF rng service. Signed-off-by: Neal Liu --- drivers/char/hw_

[PATCH v5 3/4] crypto: talitos - fix hash on SEC1.

2019-06-24 Thread Christophe Leroy
On SEC1, hash provides wrong result when performing hashing in several steps with input data SG list has more than one element. This was detected with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS: [ 44.185947] alg: hash: md5-talitos test failed (wrong result) on test vector 6, cfg="random: may_sleep use_f

[PATCH v5 4/4] crypto: talitos - drop icv_ool

2019-06-24 Thread Christophe Leroy
icv_ool is not used anymore, drop it. Fixes: e345177ded17 ("crypto: talitos - fix AEAD processing.") Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 3 --- drivers/crypto/talitos.h | 2 -- 2 files changed, 5 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/tali

[PATCH v5 2/4] crypto: talitos - move struct talitos_edesc into talitos.h

2019-06-24 Thread Christophe Leroy
Moves struct talitos_edesc into talitos.h so that it can be used from any place in talitos.c It will be required for next patch ("crypto: talitos - fix hash on SEC1") Signed-off-by: Christophe Leroy Cc: sta...@vger.kernel.org --- drivers/crypto/talitos.c | 30 -- dri

[PATCH v5 1/4] lib/scatterlist: Fix mapping iterator when sg->offset is greater than PAGE_SIZE

2019-06-24 Thread Christophe Leroy
All mapping iterator logic is based on the assumption that sg->offset is always lower than PAGE_SIZE. But there are situations where sg->offset is such that the SG item is on the second page. In that case sg_copy_to_buffer() fails properly copying the data into the buffer. One of the reason is tha

[PATCH v5 0/4] *** SUBJECT HERE ***

2019-06-24 Thread Christophe Leroy
This series is the last set of fixes for the Talitos driver. We now get a fully clean boot on both SEC1 (SEC1.2 on mpc885) and SEC2 (SEC2.2 on mpc8321E) with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS: [3.385197] bus: 'platform': really_probe: probing driver talitos with device ff02.crypto [3