From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19B1FC433F5 for ; Wed, 22 Dec 2021 13:11:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245264AbhLVNLr (ORCPT ); Wed, 22 Dec 2021 08:11:47 -0500 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]:46346 "EHLO out30-42.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240720AbhLVNLq (ORCPT ); Wed, 22 Dec 2021 08:11:46 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=tianjia.zhang@linux.alibaba.com;NM=1;PH=DS;RN=19;SR=0;TI=SMTPD_---0V.QmgAE_1640178699; Received: from 30.240.100.46(mailfrom:tianjia.zhang@linux.alibaba.com fp:SMTPD_---0V.QmgAE_1640178699) by smtp.aliyun-inc.com(127.0.0.1); Wed, 22 Dec 2021 21:11:42 +0800 Message-ID: Date: Wed, 22 Dec 2021 21:11:39 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Subject: Re: [PATCH v2 1/6] crypto: sm3 - create SM3 stand-alone library Content-Language: en-US To: Gilad Ben-Yossef Cc: Herbert Xu , "David S. Miller" , Vitaly Chikunov , Eric Biggers , Eric Biggers , Ard Biesheuvel , Jussi Kivilinna , Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Linux Crypto Mailing List , x86@kernel.org, Linux ARM , Linux kernel mailing list References: <20211222045022.27069-1-tianjia.zhang@linux.alibaba.com> <20211222045022.27069-2-tianjia.zhang@linux.alibaba.com> From: Tianjia Zhang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hi Gilad, On 12/22/21 2:59 PM, Gilad Ben-Yossef wrote: > On Wed, Dec 22, 2021 at 6:50 AM Tianjia Zhang > wrote: >> >> Stand-alone implementation of the SM3 algorithm. It is designed >> to have as little dependencies as possible. In other cases you >> should generally use the hash APIs from include/crypto/hash.h. >> Especially when hashing large amounts of data as those APIs may >> be hw-accelerated. In the new SM3 stand-alone library, >> sm3_compress() has also been optimized, instead of simply using >> the code in sm3_generic. >> > > I have a really minor nitpick: the commit message talks about changes > to sm3_compress() which was there in the original code but there is no > such function in the current code which is in a different patch and > file, so if you do another iteration for other reason, perhaps change > the commit message to refer to sm3_transform() instead? it's not > really important enough to warrant a new iteration on it's own... > > Otherwise, I'm not smart enough to evaluate the changes to > sm3_transform() cryptographically but the overall approach of moving > to a standalone library seems sane to me. > > So, for what it's worth - > > Reviewed-by: Gilad Ben-Yossef > > Gilad > Thanks for your suggestion. I agree with you. In the implementation of sm3_generic, sm3_compress() is a sub-function of sm3_transform(). The optimization is indeed for sm3_transform(). I will fix it in the next patch. Best regards, Tianjia From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5A7BC433EF for ; Wed, 22 Dec 2021 13:13:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UlQlb2g2HMnevZxyi0i+cCRM8LXe+2rQXkn01/ZlR6Y=; b=mvlWoIV8afUsC6 EwFCoK/vGBxwsUvPQGq8g7t6MejKT92nTOeHmeIlWeZA4ZjgSTkW8yiuwZ1rHz2qNPcs7S55lV59L UGBgYE7sJhjw548a1XS11qs5YkV2hQkfqU9Wj3zkk3V5hn3m9TH6jHAlaYwNbRTYENXC+jGz8VvKN o012HBu5TcVOssmJR9fiL+EZAsv+tPpy1M9KvOwhEV+uuKAtYs6nz0V/lvffhLSYXJuihIgqQat/o afi2c3h5eYrG35sgyhbwQw0jXJPuEdG1DjbFUjYA3WTKozC0lNUuK3FObFEK5vl2em9fEJWXEc7Gg 2hqPh1tzGCOo/K9jzP2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n01PM-00AP3s-Tq; Wed, 22 Dec 2021 13:11:53 +0000 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n01PI-00AP39-MD for linux-arm-kernel@lists.infradead.org; Wed, 22 Dec 2021 13:11:50 +0000 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R181e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04394; MF=tianjia.zhang@linux.alibaba.com; NM=1; PH=DS; RN=19; SR=0; TI=SMTPD_---0V.QmgAE_1640178699; Received: from 30.240.100.46(mailfrom:tianjia.zhang@linux.alibaba.com fp:SMTPD_---0V.QmgAE_1640178699) by smtp.aliyun-inc.com(127.0.0.1); Wed, 22 Dec 2021 21:11:42 +0800 Message-ID: Date: Wed, 22 Dec 2021 21:11:39 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Subject: Re: [PATCH v2 1/6] crypto: sm3 - create SM3 stand-alone library Content-Language: en-US To: Gilad Ben-Yossef Cc: Herbert Xu , "David S. Miller" , Vitaly Chikunov , Eric Biggers , Eric Biggers , Ard Biesheuvel , Jussi Kivilinna , Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Linux Crypto Mailing List , x86@kernel.org, Linux ARM , Linux kernel mailing list References: <20211222045022.27069-1-tianjia.zhang@linux.alibaba.com> <20211222045022.27069-2-tianjia.zhang@linux.alibaba.com> From: Tianjia Zhang In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_051148_961883_F19D4570 X-CRM114-Status: GOOD ( 20.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Gilad, On 12/22/21 2:59 PM, Gilad Ben-Yossef wrote: > On Wed, Dec 22, 2021 at 6:50 AM Tianjia Zhang > wrote: >> >> Stand-alone implementation of the SM3 algorithm. It is designed >> to have as little dependencies as possible. In other cases you >> should generally use the hash APIs from include/crypto/hash.h. >> Especially when hashing large amounts of data as those APIs may >> be hw-accelerated. In the new SM3 stand-alone library, >> sm3_compress() has also been optimized, instead of simply using >> the code in sm3_generic. >> > > I have a really minor nitpick: the commit message talks about changes > to sm3_compress() which was there in the original code but there is no > such function in the current code which is in a different patch and > file, so if you do another iteration for other reason, perhaps change > the commit message to refer to sm3_transform() instead? it's not > really important enough to warrant a new iteration on it's own... > > Otherwise, I'm not smart enough to evaluate the changes to > sm3_transform() cryptographically but the overall approach of moving > to a standalone library seems sane to me. > > So, for what it's worth - > > Reviewed-by: Gilad Ben-Yossef > > Gilad > Thanks for your suggestion. I agree with you. In the implementation of sm3_generic, sm3_compress() is a sub-function of sm3_transform(). The optimization is indeed for sm3_transform(). I will fix it in the next patch. Best regards, Tianjia _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel