Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2308052ybt; Tue, 16 Jun 2020 02:37:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx15JzpfGlzm+DsVp6m4vaxkV49hKpyzx6cjJ5g06fpxpmagnYqjfrk0PQJ+Syc3kjjXWs8 X-Received: by 2002:a50:af25:: with SMTP id g34mr1741573edd.85.1592300224469; Tue, 16 Jun 2020 02:37:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592300224; cv=none; d=google.com; s=arc-20160816; b=aQC77f0AJw7/j8PnGvaNqt8Qc5P/06ZOTFP4T4LaSp6oDHc2AQbtvIOX6eg98VQN7U FQWjkJyZEDk0ICnkaWt5zw388ytY4PLpAMcxDGrtqG2+eYEn+Vsj7fErOAfwBpYTMld7 HUi0qjF6ImKdUqaaU+oTn8/N9MrNilKgWfMHUB7RVGYaw+h0NnT00o7U6AkLMXraiEqO KiYVFW4xxeGSOxU5BBHsfzfVfaUcdKxZLowLJGoEnTbgWzk30MBq6LyEjpQAnDf/SM6U fvi4izsNaqdNg/atzjgo4z9xmKHPvSozULuohl8FI8qamj4MzUBkpcdWgmZWLM/s3txT PZvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:to:subject; bh=mrQDHBJ9y9+7OyRR5iIfKa+mAHFDewJ+gsbfBJBYj6Y=; b=OAIIkmqCZgR/JhWNVol/OHlex383/kQS54RsRCBMhL1UBuBsINcqSeKaLRxMS7Ers3 ttgp1mevmQfn8Kf19niVdcTbJFWIdtxd1MnSak9TKzMtVJMBXTtmkoH/JF3bzUfh6FUs nUVf7hyMxt+fC/U06s7imWVhls1XdAu/D6s80DeXc62Sc7xjndec9WFYZs2S7shCFlnJ RuLZoRAHNd4ZVfSOMFY5jfbuHut9p6gVsl9Ngdt5R8uAA9pnXpviz9BtS//ZDLfN5ydm VIWPIMbPfirULU5dEjAYVY0ZlTBsMLjGbxNl1lGraYXKU4L24rEVX13OwqzWMKvUfl6a PmQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y5si9820705edw.121.2020.06.16.02.36.33; Tue, 16 Jun 2020 02:37:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728188AbgFPJgG (ORCPT + 99 others); Tue, 16 Jun 2020 05:36:06 -0400 Received: from out30-43.freemail.mail.aliyun.com ([115.124.30.43]:44472 "EHLO out30-43.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726261AbgFPJgF (ORCPT ); Tue, 16 Jun 2020 05:36:05 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04407;MF=tianjia.zhang@linux.alibaba.com;NM=1;PH=DS;RN=19;SR=0;TI=SMTPD_---0U.m0p4p_1592300158; Received: from 30.27.116.240(mailfrom:tianjia.zhang@linux.alibaba.com fp:SMTPD_---0U.m0p4p_1592300158) by smtp.aliyun-inc.com(127.0.0.1); Tue, 16 Jun 2020 17:35:59 +0800 Subject: Re: [PATCH v3 0/8] crpyto: introduce OSCCA certificate and SM2 asymmetric algorithm To: herbert@gondor.apana.org.au, davem@davemloft.net, dhowells@redhat.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, jmorris@namei.org, serge@hallyn.com, nramas@linux.microsoft.com, tusharsu@linux.microsoft.com, zohar@linux.ibm.com, gilad@benyossef.com, pvanleeuwen@rambus.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, keyrings@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-security-module@vger.kernel.org, zhang.jia@linux.alibaba.com References: <20200609134855.21431-1-tianjia.zhang@linux.alibaba.com> <20200609205837.osganry2tyzwvanz@altlinux.org> From: Tianjia Zhang Message-ID: <254bf52e-eeb8-b615-be2a-d5cba976b63a@linux.alibaba.com> Date: Tue, 16 Jun 2020 17:35:58 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <20200609205837.osganry2tyzwvanz@altlinux.org> Content-Type: text/plain; charset=koi8-r; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 2020/6/10 4:58, Vitaly Chikunov wrote: > Tianjia, > > On Tue, Jun 09, 2020 at 09:48:47PM +0800, Tianjia Zhang wrote: >> 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-2012 >> * GM/T 0003.4-2012 >> * GM/T 0003.5-2012 >> * GM/T 0015-2012 >> * GM/T 0009-2012 >> >> IETF: https://tools.ietf.org/html/draft-shen-sm2-ecdsa-02 >> oscca: http://www.oscca.gov.cn/sca/xxgk/2010-12/17/content_1002386.shtml >> scctc: http://www.gmbz.org.cn/main/bzlb.html >> >> These patchs add the OID object identifier defined by OSCCA. The >> x509 certificate supports sm2-with-sm3 type certificate parsing >> and verification. >> >> The sm2 algorithm is based on libgcrypt's mpi implementation, and has >> made some additions to the kernel's original mpi library, and added the >> implementation of ec to better support elliptic curve-like algorithms. >> >> sm2 has good support in both openssl and gnupg projects, and sm3 and sm4 >> of the OSCCA algorithm family have also been implemented in the kernel. >> >> Among them, sm3 and sm4 have been well implemented in the kernel. >> This group of patches has newly introduced sm2. In order to implement >> sm2 more perfectly, I expanded the mpi library and introduced the >> ec implementation of the mpi library as the basic algorithm. Compared >> to the kernel's crypto/ecc.c, the implementation of mpi/ec.c is more >> complete and elegant, sm2 is implemented based on these algorithms. > > Does it use constant-time algorithms? > > Thanks, > Sorry for not responding in time. This algorithm is constant-time algorithms, and this logic is implemented in ec_mul_point(). Will you consider implementing ecrdsa based on the mpi ec algorithm in the future? Thanks and best, Tianjia