Re: [PATCH v7 4/7] crypto: add ecc curve and expose them

2021-02-08 Thread Vitaly Chikunov
Ard, On Mon, Feb 08, 2021 at 07:47:44AM +0100, Ard Biesheuvel wrote: > On Mon, 8 Feb 2021 at 07:37, Vitaly Chikunov wrote: > > > > Herbert, > > > > On Fri, Jan 29, 2021 at 02:00:04PM +1100, Herbert Xu wrote: > > > On Thu, Jan 28, 2021 at 09:49:41PM -0500, Stefan Berger wrote: > > > > > > > > In

Re: [PATCH v7 4/7] crypto: add ecc curve and expose them

2021-02-07 Thread Ard Biesheuvel
On Mon, 8 Feb 2021 at 07:37, Vitaly Chikunov wrote: > > Herbert, > > On Fri, Jan 29, 2021 at 02:00:04PM +1100, Herbert Xu wrote: > > On Thu, Jan 28, 2021 at 09:49:41PM -0500, Stefan Berger wrote: > > > > > > In my patch series I initially had registered the akciphers under the > > > names > > >

Re: [PATCH v7 4/7] crypto: add ecc curve and expose them

2021-02-07 Thread Vitaly Chikunov
Herbert, On Fri, Jan 29, 2021 at 02:00:04PM +1100, Herbert Xu wrote: > On Thu, Jan 28, 2021 at 09:49:41PM -0500, Stefan Berger wrote: > > > > In my patch series I initially had registered the akciphers under the names > > ecc-nist-p192 and ecc-nist-p256 but now, in V4, joined them together as > >

Re: [PATCH v7 4/7] crypto: add ecc curve and expose them

2021-02-03 Thread Herbert Xu
On Wed, Feb 03, 2021 at 03:03:44PM -0300, Saulo Alessandre wrote: > > In this patch I'm using akcipher allocate like ecdsa(sha1,sha256,...), > because the ecdsa algo is generic, and using the curve name and ndigits > inside vli_mmod_fast to discover the curve, but I agree the correct way > would

Re: [PATCH v7 4/7] crypto: add ecc curve and expose them

2021-02-03 Thread Herbert Xu
On Tue, Feb 02, 2021 at 12:35:26PM +, Alessandrelli, Daniele wrote: > > Unrelated question: I have my Keem Bay OCS ECC patchset [1] almost > ready for re-submission. Should I go ahead or should I wait for the > final decision about using 'ecdh-nist-pXXX' in place of 'ecdh'? If we agree on

[PATCH v7 4/7] crypto: add ecc curve and expose them

2021-02-03 Thread Saulo Alessandre
On 28/01/2021 02:03, Herbert Xu wrote: > On Fri, Jan 22, 2021 at 03:09:52PM +0800, Meng Yu wrote: >> 1. Add ecc curves(P224, P384, P521) for ECDH; > > OK I think this is getting unwieldy. > > In light of the fact that we already have hardware that supports > a specific subset of curves, I think

Re: [PATCH v7 4/7] crypto: add ecc curve and expose them

2021-02-02 Thread Alessandrelli, Daniele
On Tue, 2021-02-02 at 20:42 +1100, Herbert Xu wrote: > On Tue, Feb 02, 2021 at 09:27:33AM +, Alessandrelli, Daniele > wrote: > > I see. Just to clarify: does the in-kernel user requirement also > > apply > > to the case when the author of a device driver also provides the > > software

Re: [PATCH v7 4/7] crypto: add ecc curve and expose them

2021-02-02 Thread Herbert Xu
On Tue, Feb 02, 2021 at 09:27:33AM +, Alessandrelli, Daniele wrote: > > I see. Just to clarify: does the in-kernel user requirement also apply > to the case when the author of a device driver also provides the > software implementation for the new algorithms supported by device > driver / HW?

Re: [PATCH v7 4/7] crypto: add ecc curve and expose them

2021-02-02 Thread Alessandrelli, Daniele
On Tue, 2021-02-02 at 16:13 +1100, Herbert Xu wrote: > The issue is that we always require a software implementation for > any given hardware algorithm. As otherwise kernel users cannot > rely on the algorithm to work. I understand. This sounds very reasonable to me. > Of course we don't want

Re: [PATCH v7 4/7] crypto: add ecc curve and expose them

2021-02-01 Thread Herbert Xu
On Mon, Feb 01, 2021 at 05:09:41PM +, Daniele Alessandrelli wrote: > What's the downside of letting device drivers enable all the curves > supported by the HW (with the exception of obsolete curves / > algorithms), even if there is (currently) no user of such curves in the > kernel? Code size

Re: [PATCH v7 4/7] crypto: add ecc curve and expose them

2021-02-01 Thread Daniele Alessandrelli
On Thu, 2021-01-28 at 21:39 +1100, Herbert Xu wrote: > Once they're distinct algorithms, we can then make sure that only > the ones that are used in the kernel is added, even if some hardware > may support more curves. I like the idea of having different algorithms names (ecdh-nist- pXXX) for

Re: [PATCH v7 4/7] crypto: add ecc curve and expose them

2021-01-31 Thread yumeng
在 2021/1/28 13:03, Herbert Xu 写道: On Fri, Jan 22, 2021 at 03:09:52PM +0800, Meng Yu wrote: 1. Add ecc curves(P224, P384, P521) for ECDH; OK I think this is getting unwieldy. In light of the fact that we already have hardware that supports a specific subset of curves, I think perhaps it

Re: [PATCH v7 4/7] crypto: add ecc curve and expose them

2021-01-28 Thread Herbert Xu
On Thu, Jan 28, 2021 at 09:49:41PM -0500, Stefan Berger wrote: > > In my patch series I initially had registered the akciphers under the names > ecc-nist-p192 and ecc-nist-p256 but now, in V4, joined them together as > 'ecdsa'. This may be too generic for a name. Maybe it should be called >

Re: [PATCH v7 4/7] crypto: add ecc curve and expose them

2021-01-28 Thread Stefan Berger
On 1/28/21 5:30 AM, Ard Biesheuvel wrote: On Thu, 28 Jan 2021 at 06:04, Herbert Xu wrote: On Fri, Jan 22, 2021 at 03:09:52PM +0800, Meng Yu wrote: 1. Add ecc curves(P224, P384, P521) for ECDH; OK I think this is getting unwieldy. In light of the fact that we already have hardware that

Re: [PATCH v7 4/7] crypto: add ecc curve and expose them

2021-01-28 Thread Herbert Xu
On Thu, Jan 28, 2021 at 11:30:23AM +0100, Ard Biesheuvel wrote: > > But this also begs the question which ecdh-nist-pXXX implementations > we actually need? Why are we exposing these curves in the first place? Once they're distinct algorithms, we can then make sure that only the ones that are

Re: [PATCH v7 4/7] crypto: add ecc curve and expose them

2021-01-28 Thread Ard Biesheuvel
On Thu, 28 Jan 2021 at 06:04, Herbert Xu wrote: > > On Fri, Jan 22, 2021 at 03:09:52PM +0800, Meng Yu wrote: > > 1. Add ecc curves(P224, P384, P521) for ECDH; > > OK I think this is getting unwieldy. > > In light of the fact that we already have hardware that supports > a specific subset of

Re: [PATCH v7 4/7] crypto: add ecc curve and expose them

2021-01-27 Thread Herbert Xu
On Fri, Jan 22, 2021 at 03:09:52PM +0800, Meng Yu wrote: > 1. Add ecc curves(P224, P384, P521) for ECDH; OK I think this is getting unwieldy. In light of the fact that we already have hardware that supports a specific subset of curves, I think perhaps it would be better to move the curve ID from

[PATCH v7 4/7] crypto: add ecc curve and expose them

2021-01-21 Thread Meng Yu
1. Add ecc curves(P224, P384, P521) for ECDH; 2. Reorder ECC 'Curves ID' in 'include/crypto/ecdh.h', and modify 'curve_id' used in 'testmgr.h'; 3. Add function 'ecc_get_curve_param' in 'include/crypto/ecc_curve.h' for users, so everyone in the kernel tree can easily get ecc curve params;