Re: [PATCH v2 8/8] KVM: SVM: Allocate SEV command structures on local stack

2021-04-06 Thread Christophe Leroy
Le 07/04/2021 à 00:49, Sean Christopherson a écrit : Use the local stack to "allocate" the structures used to communicate with the PSP. The largest struct used by KVM, sev_data_launch_secret, clocks in at 52 bytes, well within the realm of reasonable stack usage. The smallest structs are a m

Re: [PATCH v2 7/8] crypto: ccp: Use the stack and common buffer for INIT command

2021-04-06 Thread Christophe Leroy
Le 07/04/2021 à 00:49, Sean Christopherson a écrit : Drop the dedicated init_cmd_buf and instead use a local variable. Now that the low level helper uses an internal buffer for all commands, using the stack for the upper layers is safe even when running with CONFIG_VMAP_STACK=y. Signed-off-b

Re: [PATCH v2 5/8] crypto: ccp: Use the stack for small SEV command buffers

2021-04-06 Thread Christophe Leroy
Le 07/04/2021 à 00:49, Sean Christopherson a écrit : For commands with small input/output buffers, use the local stack to "allocate" the structures used to communicate with the PSP. Now that __sev_do_cmd_locked() gracefully handles vmalloc'd buffers, there's no reason to avoid using the stac

[PATCH v3 4/4] ima: add support for rsa pss verification

2021-04-06 Thread Hongbo Li
This patch adds support for ima verification for rsa with pss encoding. And a patch for ima-evm-utils will be sent later. Signed-off-by: Hongbo Li --- security/integrity/digsig_asymmetric.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/security/integrit

[PATCH v3 3/4] crypto: add rsa pss test vector

2021-04-06 Thread Hongbo Li
This patch adds the test vector for rsa with pss encoding. Signed-off-by: Hongbo Li --- crypto/testmgr.c | 7 + crypto/testmgr.h | 90 2 files changed, 97 insertions(+) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 10c5b3b..

[PATCH v3 2/4] crypto: support rsa-pss encoding

2021-04-06 Thread Hongbo Li
This patch add the support of rsa-pss encoding which is described rfc8017. Similar to rsa-pkcs1, we create a pss template. Signed-off-by: Hongbo Li --- crypto/Makefile | 7 +- crypto/rsa-psspad.c | 398 ++ crypto/rsa.c

[PATCH v3 1/4] x509: add support for rsa-pss

2021-04-06 Thread Hongbo Li
This patch make x509 support rsa-pss, because the sha algo is in paramters, so we need to parse the sha parameter, and skip other params. Signed-off-by: Hongbo Li --- crypto/asymmetric_keys/Makefile| 7 ++- crypto/asymmetric_keys/public_key.c| 5 ++ crypto/asymmetri

[PATCH v3 0/4] crypto: add rsa pss support for x509

2021-04-06 Thread Hongbo Li
From: Hongbo Li This series of patches adds support for x509 cert signed by RSA with PSS encoding method. RSA PSS is described in rfc8017. Patch1 make x509 support rsa pss encoding and parse hash parameter. Patch2 add rsa pss template. Patch3 add test vector for rsa pss. Patch4 is the rsa-pss

Re: [PATCH v2 0/2] support sign module with SM2-with-SM3 algorithm

2021-04-06 Thread Tianjia Zhang
ping. Thanks, Tianjia On 3/24/21 8:15 PM, Tianjia Zhang wrote: The kernel module signature supports the option to use the SM3 secure hash (OSCCA GM/T 0004-2012 SM3). SM2 and SM3 always appear in pairs. The former is used for signing and the latter is used for hash calculation. To sign a kernel

Re: [PATCH] crypto: sm3 - use the more precise type u32 instead of unsigned int

2021-04-06 Thread Tianjia Zhang
On 3/26/21 5:38 PM, Gilad Ben-Yossef wrote: Hi, Thank you for the patch! On Fri, Mar 26, 2021 at 5:21 AM Tianjia Zhang wrote: In the process of calculating the hash, use the more accurate type 'u32' instead of the original 'unsigned int' to avoid ambiguity. I don't think there is any am

[PATCH v2 0/4] crypto: add rsa pss support for x509

2021-04-06 Thread Hongbo Li
From: Hongbo Li This series of patches adds support for x509 cert signed by RSA with PSS encoding method. RSA PSS is described in rfc8017. Patch1 make x509 support rsa pss encoding and parse hash parameter. Patch2 add rsa pss template. Patch3 add test vector for rsa pss. Patch4 is the rsa-pss

[PATCH v2 4/4] ima: add support for rsa pss verification

2021-04-06 Thread Hongbo Li
This patch adds support for ima verification for rsa with pss encoding. And a patch for ima-evm-utils will be sent later. Signed-off-by: Hongbo Li --- security/integrity/digsig_asymmetric.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/security/integrit

[PATCH v2 3/4] crypto: add rsa pss test vector

2021-04-06 Thread Hongbo Li
This patch adds the test vector for rsa with pss encoding. Signed-off-by: Hongbo Li --- crypto/testmgr.c | 7 + crypto/testmgr.h | 90 2 files changed, 97 insertions(+) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 10c5b3b..

[PATCH v2 2/4] crypto: support rsa-pss encoding

2021-04-06 Thread Hongbo Li
This patch add the support of rsa-pss encoding which is described rfc8017. Similar to rsa-pkcs1, we create a pss template. Signed-off-by: Hongbo Li --- crypto/Makefile | 7 ++- crypto/rsa.c | 14 ++--- crypto/rsa_helper.c | 127

[PATCH v2 1/4] x509: add support for rsa-pss

2021-04-06 Thread Hongbo Li
This patch make x509 support rsa-pss, because the sha algo is in paramters, so we need to parse the sha parameter, and skip other params. Signed-off-by: Hongbo Li --- crypto/asymmetric_keys/Makefile| 7 ++- crypto/asymmetric_keys/public_key.c| 5 ++ crypto/asymmetri

[PATCH 0/5] crypto: add rsa pss support for x509

2021-04-06 Thread Hongbo Li
From: Hongbo Li This series of patches adds support for x509 cert signed by RSA with PSS encoding method. RSA PSS is described in rfc8017. Patch1 make x509 support rsa pss encoding and parse hash parameter. Patch2 add rsa pss template. Patch3 add test vector for rsa pss. Patch4 is the rsa-pss

Re: [PATCH 2/5] crypto: support rsa-pss encoding

2021-04-06 Thread kernel test robot
Hi Hongbo, Thank you for the patch! Yet something to improve: [auto build test ERROR on crypto/master] [also build test ERROR on security/next-testing linus/master v5.12-rc6 next-20210406] [cannot apply to cryptodev/master] [If your patch is applied to the wrong git tree, kindly drop us a note

Re: [PATCH 1/5] x509: add support for rsa-pss

2021-04-06 Thread kernel test robot
Hi Hongbo, Thank you for the patch! Yet something to improve: [auto build test ERROR on crypto/master] [also build test ERROR on security/next-testing linus/master v5.12-rc6 next-20210406] [cannot apply to cryptodev/master] [If your patch is applied to the wrong git tree, kindly drop us a note

[PATCH] crypto: arm64/aes-ce - deal with oversight in new CTR carry code

2021-04-06 Thread Ard Biesheuvel
The new carry handling code in the CTR driver can deal with a carry occurring in the 4x/5x parallel code path, by using a computed goto to jump into the carry sequence at the right place as to only apply the carry to a subset of the blocks being processed. If the lower half of the counter wraps an

[PATCH 5/5] ima: add support for rsa pss verification

2021-04-06 Thread Hongbo Li
From: Hongbo Li This patch adds support for ima verification for rsa with pss encoding. And a patch for ima-evm-utils will be sent later. Signed-off-by: Hongbo Li --- security/integrity/digsig_asymmetric.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/security/inte

[PATCH 4/5] crypto: ecdsa ima support

2021-04-06 Thread Hongbo Li
From: Hongbo Li This patch is borrowed from Stefan Berger's ecdsa patch series, will be removed when ecdsa is merged into kernel. Signed-off-by: Hongbo Li --- include/keys/asymmetric-type.h | 6 ++ security/integrity/digsig_asymmetric.c | 29 ++--- 2 files

[PATCH 3/5] crypto: add rsa pss test vector

2021-04-06 Thread Hongbo Li
From: Hongbo Li This patch adds the test vector for rsa with pss encoding. Signed-off-by: Hongbo Li --- crypto/testmgr.c | 7 + crypto/testmgr.h | 87 2 files changed, 94 insertions(+) diff --git a/crypto/testmgr.c b/crypto/testmgr

[PATCH 2/5] crypto: support rsa-pss encoding

2021-04-06 Thread Hongbo Li
From: Hongbo Li This patch add the support of rsa-pss encoding which is described rfc8017. Similar to rsa-pkcs1, we create a pss template. Signed-off-by: Hongbo Li --- crypto/Makefile | 7 ++- crypto/rsa.c | 14 ++--- crypto/rsa_helper.c | 127 ++

[PATCH 1/5] x509: add support for rsa-pss

2021-04-06 Thread Hongbo Li
From: Hongbo Li This patch make x509 support rsa-pss, because the sha algo is in signature, so we need to parse the sha parameter, and skip other params. Signed-off-by: Hongbo Li --- crypto/asymmetric_keys/Makefile | 7 ++- crypto/asymmetric_keys/public_key.c | 5 +++ crypto/

[PATCH 0/5] crypto: add rsa pss support for x509

2021-04-06 Thread Hongbo Li
From: Hongbo Li This series of patches adds support for x509 cert signed by RSA with PSS encoding method. RSA PSS is described in rfc8017. This series of patches adds support for x509 cert signed by RSA with PSS encoding method. RSA PSS is described in rfc8017. Patch1 make x509 support rsa pss

[PATCH] crypto: hisilicon/qm - add stop queue by hardware

2021-04-06 Thread Weili Qian
Kunpeng930 could be able to stop queue by writing hardware registers, which will trigger tasks in device to be flushed out. In order to be compatible with the kunpeng920 driver, add 'qm_hw_ops_v3' to adapt Kunpeng930. And 'stop_qp' callback is added in 'qm_hw_ops_v3' to write hardware registers. C

[PATCH -next] crypto: ixp4xx -: use DEFINE_SPINLOCK() for spinlock

2021-04-06 Thread Huang Guobin
From: Guobin Huang spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init(). Reported-by: Hulk Robot Signed-off-by: Guobin Huang --- drivers/crypto/ixp4xx_crypto.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git

[PATCH -next] crypto: geode -: use DEFINE_SPINLOCK() for spinlock

2021-04-06 Thread Huang Guobin
From: Guobin Huang spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init(). Reported-by: Hulk Robot Signed-off-by: Guobin Huang --- drivers/crypto/geode-aes.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/driver