linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: yumeng <yumeng18@huawei.com>
To: <Tudor.Ambarus@microchip.com>, <herbert@gondor.apana.org.au>,
	<davem@davemloft.net>, <marcel@holtmann.org>,
	<johan.hedberg@gmail.com>, <luiz.dentz@gmail.com>
Cc: <linux-crypto@vger.kernel.org>, <xuzaibo@huawei.com>,
	<wangzhou1@hisilicon.com>, <linux-kernel@vger.kernel.org>,
	<Nicolas.Ferre@microchip.com>
Subject: Re: [PATCH v9 3/7] crypto: move curve_id of ECDH from the key to algorithm name
Date: Wed, 24 Feb 2021 09:29:34 +0800	[thread overview]
Message-ID: <fd3b7c0f-d7f2-3d27-cfef-98ec3614dd1a@huawei.com> (raw)
In-Reply-To: <8b96c136-dca9-5b6a-2221-e906d265c40b@microchip.com>



在 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?
>I think we can keep the curve id, the key size check if 'atmel-ecc' may
support other curves in the future, and if you're sure P256 is the only
curve 'atmel-ecc' uses, and it will be changed, we can delete it.

And fallback to ecdh software implementation is needed when
params.key_size is zero.

> I don't have an atecc508 at hand to test the changes, but I expect
> your changes won't affect the functionality.
> 

OK, if you or your team members have an atecc508, please help test.


  parent reply	other threads:[~2021-02-24  1:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-23  7:10 [PATCH v9 0/7] add ECDH and CURVE25519 algorithms support for Kunpeng 930 Meng Yu
2021-02-23  7:10 ` [PATCH v9 1/7] crypto: hisilicon/hpre - add version adapt to new algorithms Meng Yu
2021-02-23  7:10 ` [PATCH v9 2/7] crypto: hisilicon/hpre - add algorithm type Meng Yu
2021-02-23  7:10 ` [PATCH v9 3/7] crypto: move curve_id of ECDH from the key to algorithm name Meng Yu
2021-02-23 10:44   ` Tudor.Ambarus
2021-02-24  1:19     ` yumeng
2021-02-24  1:29     ` yumeng [this message]
2021-02-24 10:15       ` Tudor.Ambarus
2021-02-25  0:56         ` yumeng
2021-02-23  7:10 ` [PATCH v9 4/7] crypto: and expose ecc curves Meng Yu
2021-02-23  7:10 ` [PATCH v9 5/7] crypto: hisilicon/hpre - add 'ECDH' algorithm Meng Yu
2021-02-23  7:10 ` [PATCH v9 6/7] crypto: add curve25519 params and expose them Meng Yu
2021-02-23  7:10 ` [PATCH v9 7/7] crypto: hisilicon/hpre - add 'CURVE25519' algorithm Meng Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fd3b7c0f-d7f2-3d27-cfef-98ec3614dd1a@huawei.com \
    --to=yumeng18@huawei.com \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=Tudor.Ambarus@microchip.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=wangzhou1@hisilicon.com \
    --cc=xuzaibo@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).