[PATCH v2 0/3] crypto: hisilicon/hpre - misc clean up and fixes

2020-09-18 Thread yumeng 00484669
Adjust some tiny coding problems and fix a bug of DH algorithm. Changes since v1: Remove 'u64' cast in 'cpu_to_le64'; Meng Yu (3): crypto: hisilicon/hpre - remove useless code crypto: hisilicon/hpre - adjust some coding style crypto: hisilicon/hpre - fix a bug in dh algorithm drivers/cryp

[PATCH v2 1/3] crypto: hisilicon/hpre - remove useless code

2020-09-18 Thread yumeng 00484669
From: Meng Yu 1. Remove unused member 'debug_root' in 'struct hpre_debug'; 2. The u64 cast is redundant in 'cpu_to_le64'. Fixes: 848974151618("crypto: hisilicon - Add debugfs for HPRE") Fixes: dadbe4c11753("crypto: hisilicon/hpre - update debugfs ...") Signed-off-by: Meng Yu Reviewed-by: Zaibo

[PATCH v2 2/3] crypto: hisilicon/hpre - adjust some coding style

2020-09-18 Thread yumeng 00484669
From: Meng Yu Adjust some coding style to make code aligned. Signed-off-by: Meng Yu Reviewed-by: Zaibo Xu --- drivers/crypto/hisilicon/hpre/hpre_crypto.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto.c b/drivers/cr

[PATCH v2 3/3] crypto: hisilicon/hpre - fix a bug in dh algorithm

2020-09-18 Thread yumeng 00484669
From: Meng Yu Using 'g' not equal to 2 in dh algorithm may cause an error like this: arm-smmu-v3 arm-smmu-v3.1.auto: event 0x10 received: dh: Party A: generate public key test failed. err -22 11375.065672] dh alg: dh: test failed on vector 1, err=-22 arm-smmu-v3 arm-smmu-v3.1.auto: 0x79

[PATCH] crypto/chcr: fix minor indentation issue

2020-09-18 Thread Colin King
From: Colin Ian King There is a statement that is indented by one whitespace too deeply, fix this by removing the whitespace. Signed-off-by: Colin Ian King --- drivers/crypto/chelsio/chcr_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/chelsio/chcr_cor

Re: [PATCH] random: initialize ChaCha20 constants with correct endianness

2020-09-18 Thread Eric Biggers
On Fri, Sep 18, 2020 at 04:42:07PM -0400, Theodore Y. Ts'o wrote: > > We're currently not bothering to deal with Endian conversions with the counter Endianness conversion for the counter isn't needed because the implementation only treats it as words, not as bytes. (Exception: the counter does ge

Re: [PATCH] random: initialize ChaCha20 constants with correct endianness

2020-09-18 Thread Theodore Y. Ts'o
On Tue, Sep 15, 2020 at 09:50:13PM -0700, Eric Biggers wrote: > From: Eric Biggers > > On big endian CPUs, the ChaCha20-based CRNG is using the wrong > endianness for the ChaCha20 constants. > > This doesn't matter cryptographically, but technically it means it's not > ChaCha20 anymore. Fix it

Re: [PATCH v2 0/2] crypto: arm/sha-neon - avoid ADRL instructions

2020-09-18 Thread Ard Biesheuvel
On Fri, 18 Sep 2020 at 22:08, Nick Desaulniers wrote: > > On Wed, Sep 16, 2020 at 11:08 PM Ard Biesheuvel wrote: > > > > On Thu, 17 Sep 2020 at 03:53, Nick Desaulniers > > wrote: > > > > > > One thing I noticed was that if I grep for `adrl` with all of the > > > above applied within arch/arm, I

Re: [PATCH v3,net-next,3/4] drivers: crypto: add support for OCTEONTX2 CPT engine

2020-09-18 Thread Saeed Mahameed
On Thu, 2020-09-17 at 18:58 +0530, Srujana Challa wrote: > Add support for the cryptographic acceleration unit (CPT) on > > OcteonTX2 CN96XX SoC. > > > > Signed-off-by: Suheil Chandran > > Signed-off-by: Lukas Bartosik > > Signed-off-by: Srujana Challa > > --- [...] > 15 files changed,

Re: [PATCH v3,net-next,2/4] octeontx2-af: add support to manage the CPT unit

2020-09-18 Thread Saeed Mahameed
On Thu, 2020-09-17 at 18:58 +0530, Srujana Challa wrote: > > > +int rvu_mbox_handler_nix_inline_ipsec_lf_cfg(struct rvu *rvu, > > + struct nix_inline_ipsec_lf_cfg *req, struct msg_rsp > Can you do something about this code alignment ? checkpatch outputs: --

Re: [PATCH v3,net-next,0/4] Add Support for Marvell OcteonTX2 Cryptographic

2020-09-18 Thread Saeed Mahameed
On Thu, 2020-09-17 at 18:58 +0530, Srujana Challa wrote: > The following series adds support for Marvell Cryptographic > Acceleration > Unit(CPT) on OcteonTX2 CN96XX SoC. > This series is tested with CRYPTO_EXTRA_TESTS enabled and > CRYPTO_DISABLE_TESTS disabled. > I am with Jakub on this one, 10

Re: [PATCH v6 5/8] crypto: testmgr - support test with different ciphertext per encryption

2020-09-18 Thread Tianjia Zhang
On 9/18/20 2:47 PM, Herbert Xu wrote: On Thu, Sep 03, 2020 at 09:12:39PM +0800, Tianjia Zhang wrote: Some asymmetric algorithms will get different ciphertext after each encryption, such as SM2, and let testmgr support the testing of such algorithms. In struct akcipher_testvec, set c and c_si

Re: [PATCH v35 01/13] Linux Random Number Generator

2020-09-18 Thread kernel test robot
Hi "Stephan, Thank you for the patch! Yet something to improve: [auto build test ERROR on char-misc/char-misc-testing] [also build test ERROR on cryptodev/master crypto/master v5.9-rc5 next-20200918] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submi

RE: [EXT] Re: [PATCH v3,net-next,0/4] Add Support for Marvell OcteonTX2 Cryptographic

2020-09-18 Thread Srujana Challa
> Subject: [EXT] Re: [PATCH v3,net-next,0/4] Add Support for Marvell OcteonTX2 > Cryptographic > > External Email > > -- > On Thu, 17 Sep 2020 18:58:31 +0530 Srujana Challa wrote: > > The following series adds support for Marvell

[PATCH v35 02/13] LRNG - allocate one DRNG instance per NUMA node

2020-09-18 Thread Stephan Müller
In order to improve NUMA-locality when serving getrandom(2) requests, allocate one DRNG instance per node. The DRNG instance that is present right from the start of the kernel is reused as the first per-NUMA-node DRNG. For all remaining online NUMA nodes a new DRNG instance is allocated. During b

[PATCH v35 00/13] /dev/random - a new approach

2020-09-18 Thread Stephan Müller
Hi, The following patch set provides a different approach to /dev/random which is called Linux Random Number Generator (LRNG) to collect entropy within the Linux kernel. The following advantages compared to the existing /dev/random implementation are present: * Sole use of crypto for data proces

[PATCH v35 06/13] crypto: DRBG - externalize DRBG functions for LRNG

2020-09-18 Thread Stephan Müller
This patch allows several DRBG functions to be called by the LRNG kernel code paths outside the drbg.c file. CC: "Eric W. Biederman" CC: "Alexander E. Patrakov" CC: "Ahmed S. Darwish" CC: "Theodore Y. Ts'o" CC: Willy Tarreau CC: Matthew Garrett CC: Vito Caputo CC: Andreas Dilger CC: Jan Ka

[PATCH v35 05/13] LRNG - add common generic hash support

2020-09-18 Thread Stephan Müller
The LRNG switchable DRNG support also allows the replacement of the hash implementation used as conditioning component. The common generic hash support code provides the required callbacks using the synchronous hash implementations of the kernel crypto API. All synchronous hash implementations sup

[PATCH v35 04/13] LRNG - add switchable DRNG support

2020-09-18 Thread Stephan Müller
The DRNG switch support allows replacing the DRNG mechanism of the LRNG. The switching support rests on the interface definition of include/linux/lrng.h. A new DRNG is implemented by filling in the interface defined in this header file. In addition to the DRNG, the extension also has to provide a

[PATCH v35 10/13] LRNG - add Jitter RNG fast noise source

2020-09-18 Thread Stephan Müller
The Jitter RNG fast noise source implemented as part of the kernel crypto API is queried for 256 bits of entropy at the time the seed buffer managed by the LRNG is about to be filled. CC: "Eric W. Biederman" CC: "Alexander E. Patrakov" CC: "Ahmed S. Darwish" CC: "Theodore Y. Ts'o" CC: Willy Ta

[PATCH v35 11/13] LRNG - add SP800-90B compliant health tests

2020-09-18 Thread Stephan Müller
Implement health tests for LRNG's slow noise sources as mandated by SP-800-90B The file contains the following health tests: - stuck test: The stuck test calculates the first, second and third discrete derivative of the time stamp to be processed by the hash for the per-CPU entropy pool. Only

[PATCH v35 09/13] crypto: provide access to a static Jitter RNG state

2020-09-18 Thread Stephan Müller
To support the LRNG operation which uses the Jitter RNG separately from the kernel crypto API, at a time where potentially the regular memory management is not yet initialized, the Jitter RNG needs to provide a state whose memory is defined at compile time. As only once instance will ever be needed

[PATCH v35 12/13] LRNG - add interface for gathering of raw entropy

2020-09-18 Thread Stephan Müller
The test interface allows a privileged process to capture the raw unconditioned noise that is collected by the LRNG for statistical analysis. Such testing allows the analysis how much entropy the interrupt noise source provides on a given platform. Extracted noise data is not used to seed the LRNG.

[PATCH v35 13/13] LRNG - add power-on and runtime self-tests

2020-09-18 Thread Stephan Müller
Parts of the LRNG are already covered by self-tests, including: * Self-test of SP800-90A DRBG provided by the Linux kernel crypto API. * Self-test of the PRNG provided by the Linux kernel crypto API. * Raw noise source data testing including SP800-90B compliant tests when enabling CONFIG_LRNG_

[PATCH v35 01/13] Linux Random Number Generator

2020-09-18 Thread Stephan Müller
In an effort to provide a flexible implementation for a random number generator that also delivers entropy during early boot time, allows replacement of the deterministic random number generation mechanism, implement the various components in separate code for easier maintenance, and provide compli

[PATCH v35 03/13] LRNG - sysctls and /proc interface

2020-09-18 Thread Stephan Müller
The LRNG sysctl interface provides the same controls as the existing /dev/random implementation. These sysctls behave identically and are implemented identically. The goal is to allow a possible merge of the existing /dev/random implementation with this implementation which implies that this patch

[PATCH v35 07/13] LRNG - add SP800-90A DRBG extension

2020-09-18 Thread Stephan Müller
Using the LRNG switchable DRNG support, the SP800-90A DRBG extension is implemented. The DRBG uses the kernel crypto API DRBG implementation. In addition, it uses the kernel crypto API SHASH support to provide the hashing operation. The DRBG supports the choice of either a CTR DRBG using AES-256,

[PATCH v35 08/13] LRNG - add kernel crypto API PRNG extension

2020-09-18 Thread Stephan Müller
Add runtime-pluggable support for all PRNGs that are accessible via the kernel crypto API, including hardware PRNGs. The PRNG is selected with the module parameter drng_name where the name must be one that the kernel crypto API can resolve into an RNG. This allows using of the kernel crypto API PR

Re: [PATCH 3/3] crypto: hisilicon/hpre - fix a bug in dh algorithm

2020-09-18 Thread yumeng
Yes, 'u64' is redundant, I will resend one! Thank you! On 2020/9/18 15:11, Herbert Xu wrote: On Thu, Sep 10, 2020 at 07:25:22PM +0800, Meng Yu wrote: diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto.c b/drivers/crypto/hisilicon/hpre/hpre_crypto.c index 0cbe99a1

Re: [PATCH 4/7] crypto: sun4i-ss: handle BigEndian for cipher

2020-09-18 Thread Herbert Xu
On Fri, Sep 18, 2020 at 10:06:58AM +0200, LABBE Corentin wrote: > > But I think only me will see it and since I already have this on my TODO > list, I dont see any interest to leave it failing. > Furthermore, having a clean BE boot will permit to enable BE boots for thoses > SoCs on kernelCI. I'

RE: [PATCH] crypto: inside-secure - Fix corruption on not fully coherent systems

2020-09-18 Thread Van Leeuwen, Pascal
> -Original Message- > From: Herbert Xu > Sent: Friday, September 18, 2020 10:01 AM > To: Van Leeuwen, Pascal > Cc: linux-crypto@vger.kernel.org; antoine.ten...@bootlin.com; > da...@davemloft.net; Ard Biesheuvel > Subject: Re: [PATCH] crypto: inside-secure - Fix corruption on not fully

Re: [PATCH 4/7] crypto: sun4i-ss: handle BigEndian for cipher

2020-09-18 Thread LABBE Corentin
On Fri, Sep 18, 2020 at 05:31:28PM +1000, Herbert Xu wrote: > On Thu, Sep 17, 2020 at 06:35:55PM +, Corentin Labbe wrote: > > Ciphers produce invalid results on BE. > > Key and IV need to be written in LE. > > Furthermore, the non-optimized function is too complicated to convert, > > let's simp

Re: linux-next: manual merge of the staging tree with the crypto tree

2020-09-18 Thread Greg KH
On Fri, Sep 18, 2020 at 05:50:36PM +1000, Herbert Xu wrote: > On Fri, Sep 18, 2020 at 09:49:11AM +0200, Greg KH wrote: > > > > Ok, I'll go revert these. > > Thanks! > > > > As the driver has been converted over to the lib arc4 API, it > > > does not need to select CRYPTO at all. > > > > Is it co

Re: [PATCH] crypto: inside-secure - Fix corruption on not fully coherent systems

2020-09-18 Thread Herbert Xu
On Fri, Sep 18, 2020 at 07:42:35AM +, Van Leeuwen, Pascal wrote: > > Actually, that is what we did as a _quick hack_ initially, but: > > First of all, it's not only about the L1 cacheline size. It's about the worst > case cache > line size in the path all the way from the CPU to the actual me

Re: linux-next: manual merge of the staging tree with the crypto tree

2020-09-18 Thread Greg KH
On Fri, Sep 18, 2020 at 03:41:34PM +1000, Herbert Xu wrote: > On Fri, Sep 18, 2020 at 03:21:27PM +1000, Stephen Rothwell wrote: > > Hi all, > > > > Today's linux-next merge of the staging tree got a conflict in: > > > > drivers/staging/rtl8192e/Kconfig > > > > between commit: > > > > 054694

Re: linux-next: manual merge of the staging tree with the crypto tree

2020-09-18 Thread Herbert Xu
On Fri, Sep 18, 2020 at 09:49:11AM +0200, Greg KH wrote: > > Ok, I'll go revert these. Thanks! > > As the driver has been converted over to the lib arc4 API, it > > does not need to select CRYPTO at all. > > Is it converted in your tree? If so, have a branch/tag I can pull in to > prevent merge

RE: [PATCH] crypto: inside-secure - Fix corruption on not fully coherent systems

2020-09-18 Thread Van Leeuwen, Pascal
> -Original Message- > From: Herbert Xu > Sent: Friday, September 18, 2020 8:58 AM > To: Van Leeuwen, Pascal > Cc: linux-crypto@vger.kernel.org; antoine.ten...@bootlin.com; > da...@davemloft.net > Subject: Re: [PATCH] crypto: inside-secure - Fix corruption on not fully > coherent syste

Re: [PATCH 4/7] crypto: sun4i-ss: handle BigEndian for cipher

2020-09-18 Thread Herbert Xu
On Thu, Sep 17, 2020 at 06:35:55PM +, Corentin Labbe wrote: > Ciphers produce invalid results on BE. > Key and IV need to be written in LE. > Furthermore, the non-optimized function is too complicated to convert, > let's simply fallback on BE for the moment. > > Fixes: 6298e948215f2 ("crypto:

Re: [PATCH v2 1/4] crypto: caam - Fix kerneldoc

2020-09-18 Thread Herbert Xu
On Thu, Sep 10, 2020 at 09:29:16PM +0200, Krzysztof Kozlowski wrote: > Fix kerneldoc warnings like: > > drivers/crypto/caam/caamalg_qi2.c:73: warning: cannot understand function > prototype: 'struct caam_ctx' > drivers/crypto/caam/caamalg_qi2.c:2962: warning: cannot understand function > pro

Re: [PATCH] crypto: mark unused ciphers as obsolete

2020-09-18 Thread Herbert Xu
On Fri, Sep 11, 2020 at 05:11:03PM +0300, Ard Biesheuvel wrote: > We have a few interesting pieces in our cipher museum, which are never > used internally, and were only ever provided as generic C implementations. > > Unfortunately, we cannot simply remove this code, as we cannot be sure > that it

Re: [PATCH] crypto: inside-secure - Add support for EIP197 with output classifier

2020-09-18 Thread Herbert Xu
On Fri, Sep 11, 2020 at 09:46:39AM +0200, Pascal van Leeuwen wrote: > This patch adds support for EIP197 instances that include the output > classifier (OCE) option, as used by one of our biggest customers. > The OCE normally requires initialization and dedicated firmware, but > for the simple oper

Re: [PATCH] crypto: sa2ul - Fix pm_runtime_get_sync() error checking

2020-09-18 Thread Herbert Xu
On Wed, Sep 09, 2020 at 12:45:28PM +0300, Dan Carpenter wrote: > The pm_runtime_get_sync() function returns either 0 or 1 on success but > this code treats a return of 1 as a failure. > > Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver") > Signed-off-by: Dan Carpenter > --- > drivers/cry

Re: [PATCH RESEND 0/2] crypto: qat - replace DIDs macros

2020-09-18 Thread Herbert Xu
On Wed, Sep 09, 2020 at 11:59:38AM +0100, Giovanni Cabiddu wrote: > Resending patches 4 and 5 from the series "vfio/pci: add denylist and > disable qat" that didn't get apply. > > This set replaces the device IDs defined in the qat drivers with the ones > in linux/pci_ids.h and replaces the custom

Re: [PATCH 0/5] crypto: hisilicon - update ACC module parameter

2020-09-18 Thread Herbert Xu
On Thu, Sep 10, 2020 at 07:56:38PM +0800, Longfang Liu wrote: > In order to pass kernel crypto test, the ACC module parameter > pf_q_num needs to be set to an integer greater than 1, > and then fixed two bugs. > > Longfang Liu (5): > crypto: hisilicon - update mininum queue > crypto: hisilicon

Re: [PATCH] crypto: omap-sham: convert to use crypto engine

2020-09-18 Thread Herbert Xu
On Mon, Sep 07, 2020 at 10:56:10AM +0300, Tero Kristo wrote: > Convert the omap-sham driver to use crypto engine for queue handling, > instead of using local implementation. > > Signed-off-by: Tero Kristo > --- > drivers/crypto/omap-sham.c | 186 - > 1 file ch

Re: [PATCH] crypto: omap-sham: fix digcnt register handling with export/import

2020-09-18 Thread Herbert Xu
On Mon, Sep 07, 2020 at 10:56:24AM +0300, Tero Kristo wrote: > Running export/import for hashes in peculiar order (mostly done by > openssl) can mess up the internal book keeping of the OMAP SHA core. > Fix by forcibly writing the correct DIGCNT back to hardware. This issue > was noticed while tran

Re: [PATCH] crypto: inside-secure - Prevent missing of processing errors

2020-09-18 Thread Herbert Xu
On Tue, Sep 08, 2020 at 08:10:45AM +0200, Pascal van Leeuwen wrote: > On systems with coherence issues, packet processed could succeed while > it should have failed, e.g. because of an authentication fail. > This is because the driver would read stale status information that had > all error bits in

Re: [PATCH v2 00/10] crypto: hisilicon/zip - misc clean up

2020-09-18 Thread Herbert Xu
On Mon, Sep 07, 2020 at 04:21:52PM +0800, Yang Shen wrote: > This patchset make some clean up: > patch 1:remove useless parameters > patch 4:replace 'sprintf' with 'scnprintf' > patch 7:fix static check warning > and the rest patch fix some coding style > > v2: > - remove the return check of 'scnp

[PATCH v7 01/17] crypto: sun8i-ss: Add SS_START define

2020-09-18 Thread Corentin Labbe
Instead of using an hardcoded value, let's use a defined value for SS_START. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 2 +- drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH v7 10/17] crypto: sun8i-ce: handle different error registers

2020-09-18 Thread Corentin Labbe
Error registers are different across SoCs. This patch handle those difference. Signed-off-by: Corentin Labbe --- .../crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 62 --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h | 8 +++ 2 files changed, 62 insertions(+), 8 deletions(-) diff

[PATCH v7 15/17] crypto: sun8i-ce: Add support for the TRNG

2020-09-18 Thread Corentin Labbe
This patch had support for the TRNG present in the CE. Note that according to the algorithm ID, 2 version of the TRNG exists, the first present in H3/H5/R40/A64 and the second present in H6. This patch adds support for both, but only the second is working reliabily according to rngtest. Signed-off

[PATCH v7 00/17] crypto: allwinner: add xRNG and hashes

2020-09-18 Thread Corentin Labbe
Hello The main goal of this serie is to add support for TRNG, PRNG and hashes to the sun8i-ss/sun8i-ce driver. The whole serie is tested with CRYPTO_EXTRA_TESTS enabled and loading tcrypt. The PRNG and TRNG are tested with rngtest. Both LE and BE kernel are tested. This serie was tested on: - sun

[PATCH v7 08/17] crypto: sun8i-ce: move iv data to request context

2020-09-18 Thread Corentin Labbe
Instead of storing IV data in the channel context, store them in the request context. Storing them in the channel structure was conceptualy wrong since they are per request related. Signed-off-by: Corentin Labbe --- .../allwinner/sun8i-ce/sun8i-ce-cipher.c | 27 +-- drivers/

[PATCH v7 11/17] crypto: sun8i-ce: rename has_t_dlen_in_bytes to cipher_t_dlen_in_bytes

2020-09-18 Thread Corentin Labbe
Hash algorithms will need also a spetial t_dlen handling, but since the meaning will be different, rename the current flag to specify it apply only on ciphers algorithms. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c | 2 +- drivers/crypto/allwinner/sun8i-

[PATCH v7 09/17] crypto: sun8i-ce: split into prepare/run/unprepare

2020-09-18 Thread Corentin Labbe
This patch split the do_one_request into three. Prepare will handle all DMA mapping and initialisation of the task structure. Unprepare will clean all DMA mapping. And the do_one_request will be limited to just executing the task. Signed-off-by: Corentin Labbe --- .../allwinner/sun8i-ce/sun8i-ce

[PATCH v7 17/17] crypto: sun8i-ss: fix comparison of integer expressions of different signedness

2020-09-18 Thread Corentin Labbe
This patch fixes the warning: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff

[PATCH v7 13/17] crypto: sun8i-ce: Add stat_bytes debugfs

2020-09-18 Thread Corentin Labbe
This patch adds a new stat_bytes counter in the sun8i-ce debugfs. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h inde

[PATCH v7 03/17] crypto: sun8i-ss: support hash algorithms

2020-09-18 Thread Corentin Labbe
The SS support multiples hash algorithms, this patch adds support for MD5, SHA1, SHA224 and SHA256. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 9 + drivers/crypto/allwinner/sun8i-ss/Makefile| 1 + .../crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 155

[PATCH v7 16/17] crypto: sun8i-ce: fix comparison of integer expressions of different signedness

2020-09-18 Thread Corentin Labbe
This patch fixes the warning: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff

[PATCH v7 07/17] crypto: sun8i-ce: handle endianness of t_common_ctl

2020-09-18 Thread Corentin Labbe
t_common_ctl is LE32 so we need to convert its value before using it. This value is only used on H6 (ignored on other SoCs) and not handling the endianness cause failure on xRNG/hashes operations on H6 when running BE. Fixes: 06f751b61329 ("crypto: allwinner - Add sun8i-ce Crypto Engine") Signed-o

[PATCH v7 12/17] crypto: sun8i-ce: support hash algorithms

2020-09-18 Thread Corentin Labbe
The CE support multiples hash algorithms, this patch adds support for MD5, SHA1, SHA224, SHA256, SHA384 and SHA512. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 10 + drivers/crypto/allwinner/sun8i-ce/Makefile| 1 + .../crypto/allwinner/sun8i-ce/sun8i-

[PATCH v7 05/17] crypto: sun8i-ss: Add more comment on some structures

2020-09-18 Thread Corentin Labbe
This patch adds some comment on structures used by sun8i-ss. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h index da7

[PATCH v7 06/17] crypto: sun8i-ss: better debug printing

2020-09-18 Thread Corentin Labbe
This patch reworks the way debug info are printed. Instead of printing raw numbers, let's add a bit of context. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/allwinner/s

[PATCH v7 14/17] crypto: sun8i-ce: Add support for the PRNG

2020-09-18 Thread Corentin Labbe
This patch had support for the PRNG present in the CE. The output was tested with rngtest without any failure. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 8 + drivers/crypto/allwinner/sun8i-ce/Makefile| 1 + .../crypto/allwinner/sun8i-ce/sun8i-ce-co

[PATCH v7 04/17] crypto: sun8i-ss: fix a trivial typo

2020-09-18 Thread Corentin Labbe
This fixes a trivial typo. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h index 377ea7acb54d..da71d8059

[PATCH v7 02/17] crypto: sun8i-ss: Add support for the PRNG

2020-09-18 Thread Corentin Labbe
This patch had support for the PRNG present in the SS. The output was tested with rngtest without any failure. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 8 + drivers/crypto/allwinner/sun8i-ss/Makefile| 1 + .../crypto/allwinner/sun8i-ss/sun8i-ss-co

Re: [PATCH 3/3] crypto: hisilicon/hpre - fix a bug in dh algorithm

2020-09-18 Thread Herbert Xu
On Thu, Sep 10, 2020 at 07:25:22PM +0800, Meng Yu wrote: > > diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto.c > b/drivers/crypto/hisilicon/hpre/hpre_crypto.c > index 0cbe99a1..2d91593 100644 > --- a/drivers/crypto/hisilicon/hpre/hpre_crypto.c > +++ b/drivers/crypto/hisilicon/hpre/hpre_cryp