[PATCH] crypto: s5p-sss: remove redundant null check

2020-09-03 Thread Xu Wang
Because clk_disable_unprepare already checked NULL clock parameter, so the additional checks are unnecessary, just remove them. Signed-off-by: Xu Wang --- drivers/crypto/s5p-sss.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/

Re: [PATCH] crypto: s5p-sss: remove redundant null check

2020-09-03 Thread Krzysztof Kozlowski
On Thu, Sep 03, 2020 at 08:37:38AM +, Xu Wang wrote: > Because clk_disable_unprepare already checked NULL clock > parameter, so the additional checks are unnecessary, just remove them. > > Signed-off-by: Xu Wang > --- > drivers/crypto/s5p-sss.c | 6 ++ > 1 file changed, 2 insertions(+),

Re: [PATCH] crypto: s5p-sss: remove redundant null check

2020-09-03 Thread Kamil Konieczny
On 9/3/20 10:37 AM, Xu Wang wrote: > Because clk_disable_unprepare already checked NULL clock > parameter, so the additional checks are unnecessary, just remove them. > > Signed-off-by: Xu Wang > --- > drivers/crypto/s5p-sss.c | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) > >

[PATCH 1/2] crypto: hisilicon/qm - fix wrong return type of 'pci_get_drvdata'

2020-09-03 Thread Weili Qian
From: Yang Shen The parameter type of 'pci_set_drvdata' is 'struct hisi_qm', so here the return type of 'pci_get_drvdata' should be 'struct hisi_qm' too. Signed-off-by: Yang Shen Signed-off-by: Weili Qian Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/hpre/hpre_main.c | 3 +-- drivers/c

[PATCH 2/2] crypto: hisilicon/qm - remove the update of flags

2020-09-03 Thread Weili Qian
'qm_init_qp_status' is just a help function to initiate some 'QP' status. 'QP' status should be updated separately. This patch removes the updating flags in 'QP' status. Signed-off-by: Weili Qian Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/qm.c | 1 - 1 file changed, 1 deletion(-) diff

[PATCH 0/2] crypto: hisilicon - misc fixes

2020-09-03 Thread Weili Qian
This patchset fix some driver bugs Weili Qian (1): crypto: hisilicon/qm - remove the update of flags Yang Shen (1): crypto: hisilicon/qm - fix wrong return type of 'pci_get_drvdata' drivers/crypto/hisilicon/hpre/hpre_main.c | 3 +-- drivers/crypto/hisilicon/qm.c | 1 - drivers/c

Re: [PATCH 2/4] crypto: caam - Simplify with dev_err_probe()

2020-09-03 Thread Iuliana Prodan
On 9/2/2020 6:05 PM, Krzysztof Kozlowski wrote: Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Iuliana Prodan --- drivers/crypto/caam/caamalg_qi2.c | 3 +-- 1 f

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

2020-09-03 Thread Iuliana Prodan
On 9/2/2020 6:05 PM, Krzysztof Kozlowski wrote: Fix kerneldoc warnings: 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 prototype: 'struct caam_hash_ctx '

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

2020-09-03 Thread Krzysztof Kozlowski
On Thu, 3 Sep 2020 at 14:08, Iuliana Prodan wrote: > > On 9/2/2020 6:05 PM, Krzysztof Kozlowski wrote: > > Fix kerneldoc warnings: > > > >drivers/crypto/caam/caamalg_qi2.c:73: warning: cannot understand > > function prototype: 'struct caam_ctx ' > >drivers/crypto/caam/caamalg_qi2.c:2962:

[PATCH v6 8/8] integrity: Asymmetric digsig supports SM2-with-SM3 algorithm

2020-09-03 Thread Tianjia Zhang
Asymmetric digsig supports SM2-with-SM3 algorithm combination, so that IMA can also verify SM2's signature data. Signed-off-by: Tianjia Zhang Tested-by: Xufeng Zhang --- security/integrity/digsig_asymmetric.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/se

[PATCH v6 3/8] lib/mpi: Introduce ec implementation to MPI library

2020-09-03 Thread Tianjia Zhang
The implementation of EC is introduced from libgcrypt as the basic algorithm of elliptic curve, which can be more perfectly integrated with MPI implementation. Some other algorithms will be developed based on mpi ecc, such as SM2. Signed-off-by: Tianjia Zhang Tested-by: Xufeng Zhang --- include

[PATCH v6 1/8] crypto: sm3 - export crypto_sm3_final function

2020-09-03 Thread Tianjia Zhang
Both crypto_sm3_update and crypto_sm3_finup have been exported, exporting crypto_sm3_final, to avoid having to use crypto_sm3_finup(desc, NULL, 0, dgst) to calculate the hash in some cases. Signed-off-by: Tianjia Zhang Tested-by: Xufeng Zhang --- crypto/sm3_generic.c | 7 --- include/crypto

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

2020-09-03 Thread Tianjia Zhang
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_size to be empty, skip the comparison of the ciphertext, and compare the decrypted plaintext with m to achiev

[PATCH v6 0/8] crpyto: introduce OSCCA certificate and SM2 asymmetric algorithm

2020-09-03 Thread Tianjia Zhang
Hello all, This new module implement the OSCCA certificate and SM2 public key algorithm. It was published by State Encryption Management Bureau, China. List of specifications for OSCCA certificate and SM2 elliptic curve public key cryptography: * GM/T 0003.1-2012 * GM/T 0003.2-2012 * GM/T 0003.3-

[PATCH v6 2/8] lib/mpi: Extend the MPI library

2020-09-03 Thread Tianjia Zhang
Expand the mpi library based on libgcrypt, and the ECC algorithm of mpi based on libgcrypt requires these functions. Some other algorithms will be developed based on mpi ecc, such as SM2. Signed-off-by: Tianjia Zhang Tested-by: Xufeng Zhang --- include/linux/mpi.h| 87 +++ lib/mpi/

[PATCH v6 7/8] X.509: support OSCCA sm2-with-sm3 certificate verification

2020-09-03 Thread Tianjia Zhang
The digital certificate format based on SM2 crypto algorithm as specified in GM/T 0015-2012. It was published by State Encryption Management Bureau, China. The method of generating Other User Information is defined as ZA=H256(ENTLA || IDA || a || b || xG || yG || xA || yA), it also specified in ht

[PATCH v6 6/8] X.509: support OSCCA certificate parse

2020-09-03 Thread Tianjia Zhang
The digital certificate format based on SM2 crypto algorithm as specified in GM/T 0015-2012. It was published by State Encryption Management Bureau, China. This patch adds the OID object identifier defined by OSCCA. The x509 certificate supports sm2-with-sm3 type certificate parsing. It uses the s

[PATCH v6 4/8] crypto: sm2 - introduce OSCCA SM2 asymmetric cipher algorithm

2020-09-03 Thread Tianjia Zhang
This new module implement the SM2 public key algorithm. It was published by State Encryption Management Bureau, China. List of specifications for SM2 elliptic curve public key cryptography: * GM/T 0003.1-2012 * GM/T 0003.2-2012 * GM/T 0003.3-2012 * GM/T 0003.4-2012 * GM/T 0003.5-2012 IETF: https:

[PATCH] crypto: Mark tfm buffer as non leak.

2020-09-03 Thread Peter Enderborg
When running kmemleak on this I got a lot of unreferenced object 0xfff942d4ec00 (size 1024): comm "init", pid 1, jiffies 4294893619 (age 17475.864s) hex dump (first 32 bytes): 38 1d cf bd 9e ff ff ff b8 37 8b bd 9e ff ff ff 87.. 78 38 8b bd 9e ff ff ff 10 00 00 00 00 0

[PATCH v2] dt-bindings: crypto: Specify that allwinner,sun8i-a33-crypto needs reset

2020-09-03 Thread Corentin Labbe
When adding allwinner,sun8i-a33-crypto, I forgot to add that it needs reset. Furthermore, there are no need to use items to list only one compatible in compatible list. Fixes: f81547ba7a98 ("dt-bindings: crypto: add new compatible for A33 SS") Signed-off-by: Corentin Labbe --- Change since v1: -

Re: [PATCH 1/2] crypto: hisilicon/qm - fix wrong return type of 'pci_get_drvdata'

2020-09-03 Thread kernel test robot
Hi Weili, Thank you for the patch! Yet something to improve: [auto build test ERROR on cryptodev/master] [also build test ERROR on crypto/master sparc-next/master v5.9-rc3 next-20200903] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we

[PATCH 1/3] dt-bindings: crypto: slimsss: Correct a typo in compatible

2020-09-03 Thread Krzysztof Kozlowski
Correct a typo in the compatible - missing trailing 's'. Signed-off-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/crypto/samsung-slimsss.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/crypto/samsung-slimsss.yaml b/Docum

[PATCH 2/3] crypto: s5p-sss - Add and fix kerneldoc

2020-09-03 Thread Krzysztof Kozlowski
Add missing and fix existing kerneldoc to silence W=1 warnings: drivers/crypto/s5p-sss.c:333: warning: Function parameter or member 'pclk' not described in 's5p_aes_dev' drivers/crypto/s5p-sss.c:373: warning: Function parameter or member 'sgl' not described in 's5p_hash_reqctx' drivers/cry

[PATCH 3/3] crypto: s5p-sss - Pass error from clk_get and reduce verbosity on deferral

2020-09-03 Thread Krzysztof Kozlowski
Pass the error directly from devm_clk_get() to describe the real reason, instead of fixed ENOENT. Do not print error messages on deferred probe. Signed-off-by: Krzysztof Kozlowski --- drivers/crypto/s5p-sss.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/dr