crypto: sm2 - remove unnecessary reset operations
authorTianjia Zhang <tianjia.zhang@linux.alibaba.com>
Thu, 15 Oct 2020 09:24:41 +0000 (17:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:56:06 +0000 (16:56 +0200)
commitd598b8b77b17cf1f62659c62998e05992eb998d4
treec52816af8e6ae4e569a4fc4c20c8dfa16a2b2eee
parentdeef40c47e66a41c45dac93481e3b3751ab85123
crypto: sm2 - remove unnecessary reset operations

[ Upstream commit 1bc608b4655b8b1491fb100f4cf4f15ae64a8698 ]

This is an algorithm optimization. The reset operation when
setting the public key is repeated and redundant, so remove it.
At the same time, `sm2_ecc_os2ec()` is optimized to make the
function more simpler and more in line with the Linux code style.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
crypto/sm2.c