Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp45629pxb; Tue, 23 Feb 2021 17:32:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuSIL0c70cLRwKvPm1fpASr3nnL+2013k81Ml/2QhHkVbhNtbWg8qWrEmWx9syAX0z06Gb X-Received: by 2002:aa7:c94a:: with SMTP id h10mr32096188edt.41.1614130371233; Tue, 23 Feb 2021 17:32:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614130371; cv=none; d=google.com; s=arc-20160816; b=hU3jwLuEfrHyMuPtB7BhM0eSNyitTZ77mDOU3DPphESCe/IH9IcXWTAlYGK8/W1rTw p1fovopKBBsqRzU9XaHowu7+fF4bdFI+MubMu5iHUzhpgBaq3qgH/MbhGNGeG+TBHWDx bgSAFPwfiJhaOoeGn2LqDFxEWVqgEZ+NNstSOAxls8T4iIUuv3SgOr1C+9BBWuOZWDqA h0SK7QRTe34TxzAAs1fbLSQmSZOc1b5uYRSpCOL2rfSIFZdFtLui9snmAOhIVfuHWALL zxcteBPhppuos95EeDoOWE3dohHmGyLN8Y/xtAq5YqLijQGolqEc8wW8SdRROI1UoYyQ b+oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=NsepdbM3nf3JjkXgFaS9F4ONkuZJy8XyOq3o+cCkAnk=; b=IAISJ1ffgW3V4X7j1p95PlILfFY0AtQ/44SP0XuHjnudAIww6vDiU2A3dBik6Nj2Xh eY5BHie1sTvWjP8CddgfmPtgaX2+pmarHDyfXCIfH+FDnqmes19n6bLYA2haG0sjsrhR SVmlpauerFh6Q7aoj0WgoOOzn/FlvwNTQb6a+i73lHQGL9816tNnp610TgkzOq2FZPsI jEJfzuLf971BJdy9rqSvT99ODJrVOWOcSp6X1V6C7y14+mlO3BGcs5LQsjHwXvj1IzFt Tab5M5kJd+L6dhG0Nw8wWOFf33IU8eOWLJHH016fY90tIYD/Lyr3JK8paxc3cLECIcrQ sUPA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t8si119232edy.573.2021.02.23.17.32.20; Tue, 23 Feb 2021 17:32:51 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231974AbhBXBaG (ORCPT + 99 others); Tue, 23 Feb 2021 20:30:06 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:12992 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232156AbhBXBUp (ORCPT ); Tue, 23 Feb 2021 20:20:45 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DldMK1ZKDzjRlK; Wed, 24 Feb 2021 09:17:49 +0800 (CST) Received: from [10.67.103.10] (10.67.103.10) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.498.0; Wed, 24 Feb 2021 09:19:13 +0800 Subject: Re: [PATCH v9 3/7] crypto: move curve_id of ECDH from the key to algorithm name To: , , , , , CC: , , , , References: <1614064219-40701-1-git-send-email-yumeng18@huawei.com> <1614064219-40701-4-git-send-email-yumeng18@huawei.com> <8b96c136-dca9-5b6a-2221-e906d265c40b@microchip.com> From: yumeng Message-ID: <4f16302b-7002-fd96-f08c-245f49e3233c@huawei.com> Date: Wed, 24 Feb 2021 09:19:08 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <8b96c136-dca9-5b6a-2221-e906d265c40b@microchip.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.10] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 在 2021/2/23 18:44, Tudor.Ambarus@microchip.com 写道: > Hi, > > On 2/23/21 9:10 AM, Meng Yu wrote: >> --- a/drivers/crypto/atmel-ecc.c >> +++ b/drivers/crypto/atmel-ecc.c >> @@ -104,7 +104,7 @@ static int atmel_ecdh_set_secret(struct crypto_kpp *tfm, const void *buf, >> return -EINVAL; >> } >> >> - ctx->n_sz = atmel_ecdh_supported_curve(params.curve_id); >> + ctx->n_sz = atmel_ecdh_supported_curve(ctx->curve_id); >> if (!ctx->n_sz || params.key_size) { >> /* fallback to ecdh software implementation */ >> ctx->do_fallback = true; > > Now that you moved the curve id info into the alg name, and it is > no longer dynamically discovered when decoding the key, does it > still make sense to keep the curve id, the key size checks, and > the fallback to the software implementation? > Yes, I think we can keep this code if 'atmel-ecc' may support new other curves at future, and if you're sure P256 is the only curve 'atmel-ecc' uses, and it will never be changed, we can delete it. > I don't have an atecc508 at hand to test the changes, but I expect > your changes won't affect the functionality. > OK, when you or your team members have an atecc508, please help test.