Re: [PATCH v5 2/2] hwrng: bcm2835: add reset support

2021-03-04 Thread Philipp Zabel
On Thu, 2021-03-04 at 08:33 +0100, Álvaro Fernández Rojas wrote: > BCM6368 devices need to reset the in order to generate true random numbers. > This is what BCM6368 produces without a reset: > root@OpenWrt:/# cat /dev/hwrng | rngtest -c 1000 > rngtest 6.10 > Copyright (c) 2004 by Henrique de Morae

Re: [PATCH 05/10] crypto: keembay: ocs-hcu: Fix incorrectly named functions/structs

2021-03-04 Thread Alessandrelli, Daniele
Hi Lee, Thanks for the patch. On Wed, 2021-03-03 at 14:34 +, Lee Jones wrote: > Fixes the following W=1 kernel build warning(s): > > drivers/crypto/keembay/ocs-hcu.c:107: warning: expecting prototype for > struct ocs_hcu_dma_list. Prototype was for struct ocs_hcu_dma_entry instead > drive

Re: [PATCH v3 1/2] dt-bindings: rng: bcm2835: document reset support

2021-03-04 Thread Nicolas Saenz Julienne
Hi Alvaro, On Tue, 2021-02-23 at 18:00 +0100, Álvaro Fernández Rojas wrote: > Some devices may need to perform a reset before using the RNG, such as the > BCM6368. > > Signed-off-by: Álvaro Fernández Rojas > --- >  v3: make resets required if brcm,bcm6368-rng. >  v2: document reset support. > >

Re: [PATCH v5 1/2] dt-bindings: rng: bcm2835: document reset support

2021-03-04 Thread Nicolas Saenz Julienne
Sorry Alvaro I missed you sent a v5 already. See my comments in v3. Regards, Nicolas On Thu, 2021-03-04 at 08:33 +0100, Álvaro Fernández Rojas wrote: > Some devices may need to perform a reset before using the RNG, such as the > BCM6368. > > Signed-off-by: Álvaro Fernández Rojas > --- >  v5: no

Re: [PATCH v3 1/2] dt-bindings: rng: bcm2835: document reset support

2021-03-04 Thread Álvaro Fernández Rojas
> El 4 mar 2021, a las 13:07, Nicolas Saenz Julienne > escribió: > > Hi Alvaro, > > On Tue, 2021-02-23 at 18:00 +0100, Álvaro Fernández Rojas wrote: >> Some devices may need to perform a reset before using the RNG, such as the >> BCM6368. >> >> Signed-off-by: Álvaro Fernández Rojas >> ---

Re: [PATCH v3 1/2] dt-bindings: rng: bcm2835: document reset support

2021-03-04 Thread Nicolas Saenz Julienne
On Thu, 2021-03-04 at 13:18 +0100, Álvaro Fernández Rojas wrote: > > > El 4 mar 2021, a las 13:07, Nicolas Saenz Julienne > > escribió: > > > > Hi Alvaro, > > > > On Tue, 2021-02-23 at 18:00 +0100, Álvaro Fernández Rojas wrote: > > > Some devices may need to perform a reset before using the RN

Re: [PATCH] crypto: qat - fix use of 'dma_map_single'

2021-03-04 Thread Dan Carpenter
Hi Hui, url: https://github.com/0day-ci/linux/commits/Hui-Tang/crypto-qat-fix-use-of-dma_map_single/20210301-114717 base: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master config: i386-randconfig-m021-20210304 (attached as .config) compiler: gcc-9 (Debian

Re: [PATCH v9 6/9] crypto: Add NIST P384 curve parameters

2021-03-04 Thread Stefan Berger
On 3/4/21 12:28 AM, Herbert Xu wrote: On Thu, Feb 25, 2021 at 11:07:59AM -0500, Stefan Berger wrote: From: Saulo Alessandre * crypto/ecc_curve_defs.h - add nist_p384 params * include/crypto/ecdh.h - add ECC_CURVE_NIST_P384 Signed-off-by: Saulo Alessandre Tested-by: Stefan Berger ---

Re: [PATCH v3 1/2] dt-bindings: rng: bcm2835: document reset support

2021-03-04 Thread Álvaro Fernández Rojas
Hi Nicolas, > El 4 mar 2021, a las 14:30, Nicolas Saenz Julienne > escribió: > > On Thu, 2021-03-04 at 13:18 +0100, Álvaro Fernández Rojas wrote: >> >>> El 4 mar 2021, a las 13:07, Nicolas Saenz Julienne >>> escribió: >>> >>> Hi Alvaro, >>> >>> On Tue, 2021-02-23 at 18:00 +0100, Álvaro Fer

Re: [PATCH] hwrng: bcm2835: set quality to 1000

2021-03-04 Thread Nicolas Saenz Julienne
On Wed, 2021-03-03 at 10:29 +0100, Álvaro Fernández Rojas wrote: > Hi Herbert, > > > El 3 mar 2021, a las 10:20, Herbert Xu > > escribió: > > > > On Sat, Feb 20, 2021 at 08:12:45PM +0100, Álvaro Fernández Rojas wrote: > > > > > > I ran rngtest and this is what I got: > > > > This is meaningle

Re: CAAM: kernel BUG at drivers/crypto/caam/jr.c:230! (and dma-coherent query)

2021-03-04 Thread Robin Murphy
On 2021-03-03 16:40, Horia Geantă wrote: On 3/3/2021 4:57 PM, Sascha Hauer wrote: On Wed, Mar 03, 2021 at 12:26:32PM +0200, Horia Geantă wrote: Adding some people in the loop, maybe they could help in understanding why lack of "dma-coherent" property for a HW-coherent device could lead to unexp

Re: [PATCH 0/7] Add support for AEAD algorithms in Qualcomm Crypto Engine driver

2021-03-04 Thread Thara Gopinath
On Thu, 4 Mar 2021 at 00:30, Herbert Xu wrote: > > On Thu, Feb 25, 2021 at 01:27:09PM -0500, Thara Gopinath wrote: > > Enable support for AEAD algorithms in Qualcomm CE driver. The first three > > patches in this series are cleanups and add a few missing pieces required > > to add support for AEA

Re: [PATCH v3 1/2] dt-bindings: rng: bcm2835: document reset support

2021-03-04 Thread Rob Herring
On Thu, Mar 4, 2021 at 6:07 AM Nicolas Saenz Julienne wrote: > > Hi Alvaro, > > On Tue, 2021-02-23 at 18:00 +0100, Álvaro Fernández Rojas wrote: > > Some devices may need to perform a reset before using the RNG, such as the > > BCM6368. > > > > Signed-off-by: Álvaro Fernández Rojas > > --- > > v

Re: [PATCH v5 1/2] dt-bindings: rng: bcm2835: document reset support

2021-03-04 Thread Rob Herring
On Thu, 04 Mar 2021 08:33:07 +0100, Álvaro Fernández Rojas wrote: > Some devices may need to perform a reset before using the RNG, such as the > BCM6368. > > Signed-off-by: Álvaro Fernández Rojas > --- > v5: no changes. > v4: pass dt_binding_check. > v3: make resets required if brcm,bcm636

Re: [PATCH] hwrng: bcm2835: set quality to 1000

2021-03-04 Thread Florian Fainelli
On 3/4/21 7:11 AM, Nicolas Saenz Julienne wrote: > On Wed, 2021-03-03 at 10:29 +0100, Álvaro Fernández Rojas wrote: >> Hi Herbert, >> >>> El 3 mar 2021, a las 10:20, Herbert Xu >>> escribió: >>> >>> On Sat, Feb 20, 2021 at 08:12:45PM +0100, Álvaro Fernández Rojas wrote: I ran rngtest an

Re: [PATCH v9 6/9] crypto: Add NIST P384 curve parameters

2021-03-04 Thread Herbert Xu
On Thu, Mar 04, 2021 at 08:59:36AM -0500, Stefan Berger wrote: > > Are you going to take the other patches as well, except for maybe 9/9, which > depends on Nayan's patch series. Mimi suggested to me to ask you whether you > could create a topic branch where we can apply other patches to, such as >

Re: [PATCH] crypto: ccp - Don't initialize SEV support without the SEV feature

2021-03-04 Thread Brijesh Singh
On 3/3/21 4:31 PM, Tom Lendacky wrote: > From: Tom Lendacky > > If SEV has been disabled (e.g. through BIOS), the driver probe will still > issue SEV firmware commands. The SEV INIT firmware command will return an > error in this situation, but the error code is a general error code that > doesn

[PATCH v10 0/9] Add support for x509 certs with NIST P384/256/192 keys

2021-03-04 Thread Stefan Berger
From: Stefan Berger This series of patches adds support for x509 certificates signed by a CA that uses NIST P384, P256 or P192 keys for signing. It also adds support for certificates where the public key is one of this type of a key. The math for ECDSA signature verification is also added as well

[PATCH v10 5/9] x509: Detect sm2 keys by their parameters OID

2021-03-04 Thread Stefan Berger
From: Stefan Berger Detect whether a key is an sm2 type of key by its OID in the parameters array rather than assuming that everything under OID_id_ecPublicKey is sm2, which is not the case. Cc: David Howells Cc: keyri...@vger.kernel.org Signed-off-by: Stefan Berger Reviewed-by: Tianjia Zhang

[PATCH v10 6/9] x509: Add support for parsing x509 certs with ECDSA keys

2021-03-04 Thread Stefan Berger
From: Stefan Berger This patch adds support for parsing of x509 certificates that contain ECDSA keys, such as NIST P256, that have been signed by a CA using any of the current SHA hash algorithms. Cc: David Howells Cc: keyri...@vger.kernel.org Signed-off-by: Stefan Berger --- v7->v8: - do n

[PATCH v10 7/9] ima: Support EC keys for signature verification

2021-03-04 Thread Stefan Berger
From: Stefan Berger Add support for IMA signature verification for EC keys. Since SHA type of hashes can be used by RSA and ECDSA signature schemes we need to look at the key and derive from the key which signature scheme to use. Since this can be applied to all types of keys, we change the selec

[PATCH v10 9/9] certs: Add support for using elliptic curve keys for signing modules

2021-03-04 Thread Stefan Berger
From: Stefan Berger This patch adds support for using elliptic curve keys for signing modules. It uses a NIST P384 (secp384r1) key if the user chooses an elliptic curve key and will have ECDSA support built into the kernel. Note: A developer choosing an ECDSA key for signing modules has to manua

[PATCH v10 2/9] crypto: Add NIST P384 curve parameters

2021-03-04 Thread Stefan Berger
From: Saulo Alessandre * crypto/ecc_curve_defs.h - add nist_p384 params * include/crypto/ecdh.h - add ECC_CURVE_NIST_P384 * crypto/ecc.c - change ecc_get_curve to accept nist_p384 Signed-off-by: Saulo Alessandre Tested-by: Stefan Berger --- crypto/ecc.c| 2 ++ crypto/ecc_

[PATCH v10 1/9] crypto: Add support for ECDSA signature verification

2021-03-04 Thread Stefan Berger
From: Stefan Berger Add support for parsing the parameters of a NIST P256 or NIST P192 key. Enable signature verification using these keys. The new module is enabled with CONFIG_ECDSA: Elliptic Curve Digital Signature Algorithm (NIST P192, P256 etc.) is A NIST cryptographic standard algorithm

[PATCH v10 3/9] crypto: Add math to support fast NIST P384

2021-03-04 Thread Stefan Berger
From: Saulo Alessandre * crypto/ecc.c - add vli_mmod_fast_384 - change some routines to pass ecc_curve forward until vli_mmod_fast * crypto/ecc.h - add ECC_CURVE_NIST_P384_DIGITS - change ECC_MAX_DIGITS to P384 size Signed-off-by: Saulo Alessandre Tested-by: Stefan Berger --- crypto/

[PATCH v10 8/9] x509: Add OID for NIST P384 and extend parser for it

2021-03-04 Thread Stefan Berger
From: Saulo Alessandre * crypto/asymmetric_keys/x509_cert_parser.c - prepare x509 parser to load nist_secp384r1 * include/linux/oid_registry.h - add OID_id_secp384r1 Signed-off-by: Saulo Alessandre Tested-by: Stefan Berger --- crypto/asymmetric_keys/x509_cert_parser.c | 3 +++ include/li

[PATCH v10 4/9] ecdsa: Register NIST P384 and extend test suite

2021-03-04 Thread Stefan Berger
From: Saulo Alessandre * crypto/ecdsa.c - add ecdsa_nist_p384_init_tfm - register and unregister P384 tfm * crypto/testmgr.c - add test vector for P384 on vector of tests * crypto/testmgr.h - add test vector params for P384(sha1, sha224, sha256, sha384 and sha512) Signed-off-by: Sa

Re: [PATCH v10 0/9] Add support for x509 certs with NIST P384/256/192 keys

2021-03-04 Thread Stefan Berger
Herbert,    you can take patches 1-8. 9 will not apply without Nayna's series as mentioned in the patch. Regards,    Stefan On 3/4/21 7:51 PM, Stefan Berger wrote: From: Stefan Berger This series of patches adds support for x509 certificates signed by a CA that uses NIST P384, P256 or P19

[PATCH] crypto: allwinner: sun8i-ce: fix error return code in sun8i_ce_prng_generate()

2021-03-04 Thread Jia-Ju Bai
When dma_mapping_error() returns an error, no error return code of sun8i_ce_prng_generate() is assigned. To fix this bug, err is assigned with -EFAULT as error return code. Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-prng.c | 1 + 1 file cha

Re: [PATCH] hwrng: bcm2835: set quality to 1000

2021-03-04 Thread Álvaro Fernández Rojas
Hi Florian, > El 4 mar 2021, a las 23:28, Florian Fainelli escribió: > > On 3/4/21 7:11 AM, Nicolas Saenz Julienne wrote: >> On Wed, 2021-03-03 at 10:29 +0100, Álvaro Fernández Rojas wrote: >>> Hi Herbert, >>> El 3 mar 2021, a las 10:20, Herbert Xu escribió: On Sat, Feb 2

[PATCH v2 2/2] crypto: qat - fix use of 'dma_map_single'

2021-03-04 Thread Hui Tang
DMA_TO_DEVICE synchronisation must be done after the last modification of the memory region by the software and before it is handed off to the device. Signed-off-by: Hui Tang Reported-by: kernel test robot Reported-by: Dan Carpenter --- drivers/crypto/qat/qat_common/qat_algs.c | 27 +++

[PATCH v2 1/2] crypto: qat - fix unmap invalid dma address

2021-03-04 Thread Hui Tang
'dma_mapping_error' return a negative value if 'dma_addr' is equal to 'DMA_MAPPING_ERROR' not zero, so fix initialization of 'dma_addr'. Signed-off-by: Hui Tang --- drivers/crypto/qat/qat_common/qat_algs.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/cr

[PATCH v2 0/2] crypto: qat - fixes related to 'dma_map_single'

2021-03-04 Thread Hui Tang
This patchset fix bugs related to 'dma_map_single' use: Hui Tang (2): crypto: qat - fix 'dma_unmap_single' invalid address crypto: qat - fix use of 'dma_map_single' v1 -> v2: 1.fix build warning reported by kernel test rebot 2.add patch #1 drivers/crypto/qat/qat_common/qat_

[PATCH v6 0/3] hwrng: bcm2835: add reset support

2021-03-04 Thread Álvaro Fernández Rojas
Some devices may need to perform a reset before using the RNG, such as the BCM6368. v6: fix dt-bindings documentation, add patch makings clocks mandatory for BCM6368. v5: remove reset_control_rearm() and apply on latest herbert/cryptodev-2.6.git. v4: fix documentation, add reset_control_rearm().

[PATCH v6 1/3] dt-bindings: rng: bcm2835: add clock constraints

2021-03-04 Thread Álvaro Fernández Rojas
brcm,bcm6368-rng controllers require enabling the IPSEC clock in order to get a functional RNG. Signed-off-by: Álvaro Fernández Rojas --- v6: add new patch making clocks mandatory for BCM6368. .../devicetree/bindings/rng/brcm,bcm2835.yaml | 10 ++ 1 file changed, 10 insertions

[PATCH v6 3/3] hwrng: bcm2835: add reset support

2021-03-04 Thread Álvaro Fernández Rojas
BCM6368 devices need to reset the IPSEC controller in order to generate true random numbers. This is what BCM6368 produces without a reset: root@OpenWrt:/# cat /dev/hwrng | rngtest -c 1000 rngtest 6.10 Copyright (c) 2004 by Henrique de Moraes Holschuh This is free software; see the source for copy

[PATCH v6 2/3] dt-bindings: rng: bcm2835: document reset support

2021-03-04 Thread Álvaro Fernández Rojas
brcm,bcm6368-rng controllers require resetting the IPSEC clock in order to get a functional RNG. Signed-off-by: Álvaro Fernández Rojas --- v6: fix dt-bindings warnings. v5: no changes. v4: pass dt_binding_check. v3: make resets required if brcm,bcm6368-rng. v2: document reset support. .../

Re: [PATCH v9 2/9] x509: Detect sm2 keys by their parameters OID

2021-03-04 Thread Tianjia Zhang
Hi, On 3/4/21 7:46 AM, Stefan Berger wrote: Tianjia,    can you say whether SM2 support works for you before and after applying this patch? I cannot verify it with an sm2 key I have created using a sequence of commands like this: > modprobe sm2_generic > id=$(keyctl newring test @u) > k

Re: [PATCH v10 5/9] x509: Detect sm2 keys by their parameters OID

2021-03-04 Thread Tianjia Zhang
Hi, On 3/5/21 8:51 AM, Stefan Berger wrote: From: Stefan Berger Detect whether a key is an sm2 type of key by its OID in the parameters array rather than assuming that everything under OID_id_ecPublicKey is sm2, which is not the case. Cc: David Howells Cc: keyri...@vger.kernel.org Signed-off