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

2020-09-20 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

[PATCH v7 00/10] crpyto: introduce OSCCA certificate and SM2 asymmetric algorithm

2020-09-20 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 v7 07/10] crypto: sm2 - add SM2 test vectors to testmgr

2020-09-20 Thread Tianjia Zhang
Add testmgr test vectors for SM2 algorithm. These vectors come from `openssl pkeyutl -sign` and libgcrypt. Signed-off-by: Tianjia Zhang Tested-by: Xufeng Zhang --- crypto/testmgr.c | 6 + crypto/testmgr.h | 59 2 files changed, 65 insertions

[PATCH v7 10/10] integrity: Asymmetric digsig supports SM2-with-SM3 algorithm

2020-09-20 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 Reviewed-by: Mimi Zohar Reviewed-by: Vitaly Chikunov --- security/integrity/digsig_asymmetric.c | 14 +++--- 1 file cha

[PATCH v7 03/10] lib/mpi: Introduce ec implementation to MPI library

2020-09-20 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 v7 02/10] lib/mpi: Extend the MPI library

2020-09-20 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 v7 05/10] crypto: testmgr - support test with different ciphertext per encryption

2020-09-20 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 v7 01/10] crypto: sm3 - export crypto_sm3_final function

2020-09-20 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 v7 04/10] crypto: sm2 - introduce OSCCA SM2 asymmetric cipher algorithm

2020-09-20 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 v7 09/10] X.509: support OSCCA SM2-with-SM3 certificate verification

2020-09-20 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 v7 06/10] crypto: testmgr - Fix potential memory leak in test_akcipher_one()

2020-09-20 Thread Tianjia Zhang
When the 'key' allocation fails, the 'req' will not be released, which will cause memory leakage on this path. This patch adds a 'free_req' tag used to solve this problem, and two new err values are added to reflect the real reason of the error. Signed-off-by: Tianjia Zhang --- crypto/testmgr.c

[PATCH v7 08/10] X.509: support OSCCA certificate parse

2020-09-20 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

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

2020-09-20 Thread Stephan Mueller
Am Freitag, 18. September 2020, 15:02:17 CEST schrieb kernel test robot: Hi, > All errors (new ones prefixed by >>): > >> drivers/char/lrng/lrng_chacha20.c:33:8: error: structure variable > >> 'chacha20' with 'latent_entropy' attribute has a non-integer field > >> 'block' > 33 | struct chac

Re: [PATCH -next v2] crypto: caam: Convert to DEFINE_SHOW_ATTRIBUTE

2020-09-20 Thread Horia Geantă
On 9/18/2020 4:30 AM, Qinglang Miao wrote: > Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. > > Signed-off-by: Qinglang Miao Reviewed-by: Horia Geantă Thanks, Horia

[PATCH v2 5/7] crypto: sun4i-ss: initialize need_fallback

2020-09-20 Thread Corentin Labbe
The need_fallback is never initialized and seem to be always true at runtime. So all hardware operations are always bypassed. Fixes: 0ae1f46c55f87 ("crypto: sun4i-ss - fallback when length is not multiple of blocksize") Cc: Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/su

[PATCH v2 2/7] crypto: sun4i-ss: checking sg length is not sufficient

2020-09-20 Thread Corentin Labbe
The optimized cipher function need length multiple of 4 bytes. But it get sometimes odd length. This is due to SG data could be stored with an offset. So the fix is to check also if the offset is aligned with 4 bytes. Fixes: 6298e948215f2 ("crypto: sunxi-ss - Add Allwinner Security System crypto

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

2020-09-20 Thread Corentin Labbe
Ciphers produce invalid results on BE. Key and IV need to be written in LE. Fixes: 6298e948215f2 ("crypto: sunxi-ss - Add Allwinner Security System crypto accelerator") Cc: Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c | 12 ++-- 1 file changed,

[PATCH v2 0/7] crypto: sun4i-ss: prevent always fallback for ciphers

2020-09-20 Thread Corentin Labbe
Hello For help testing on "crypto: sun4i-ss - Fix sparse endianness markers", I have added "stats" support like other allwinner's crypto drivers. Seeing stats showed a clear problem, the ciphers function were not used at all. This is due to the not-inialized need_fallback which is "init" as true e

[PATCH v2 3/7] crypto: sun4i-ss: IV register does not work on A10 and A13

2020-09-20 Thread Corentin Labbe
Allwinner A10 and A13 SoC have a version of the SS which produce invalid IV in IVx register. Instead of adding a variant for those, let's convert SS to produce IV directly from data. Fixes: 6298e948215f2 ("crypto: sunxi-ss - Add Allwinner Security System crypto accelerator") Cc: Signed-off-by: C

[PATCH v2 7/7] crypto: sun4i-ss: add SPDX header and remove blank lines

2020-09-20 Thread Corentin Labbe
This patchs fixes some remaining style issue. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c | 3 --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-prng.c | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/crypto/allwinner/sun4i-ss/

[PATCH v2 1/7] crypto: sun4i-ss: linearize buffers content must be kept

2020-09-20 Thread Corentin Labbe
When running the non-optimized cipher function, SS produce partial random output. This is due to linearize buffers being reseted after each loop. Fixes: 8d3bcb9900ca ("crypto: sun4i-ss - reduce stack usage") Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c |

[PATCH v2 6/7] crypto: sun4i-ss: enabled stats via debugfs

2020-09-20 Thread Corentin Labbe
This patch enable to access usage stats for each algorithm. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 9 .../allwinner/sun4i-ss/sun4i-ss-cipher.c | 21 .../crypto/allwinner/sun4i-ss/sun4i-ss-core.c | 54 +++ .../crypto/a

DOBRÉ ZPRÁVY

2020-09-20 Thread MRS. CORIS WHENT
Můj drahý příjemce, Jsem si jist, že vám tato pošta přijde jako překvapení, protože jsme se nikdy předtím nesetkali a také byste se ptali, proč jsem se rozhodl vybrat vás mezi četnými uživateli internetu na světě. Vaše e-mailová adresa se objevila v náhodném losování, které provedla podpora cha

linux-next: manual merge of the crypto tree with Linus' tree

2020-09-20 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the crypto tree got a conflict in: drivers/crypto/Kconfig between commit: bfe8fe939a04 ("crypto: sa2ul - add Kconfig selects to fix build error") from Linus' tree and commit: 61f033ba18c3 ("crypto: sa2ul - Select CRYPTO_AUTHENC") from the crypto tree