Re: [PATCH] crypto: implement DH primitives under akcipher API

2016-03-08 Thread Marcel Holtmann
Hi Tadeusz, >>> In this way we can define a generic user side of the key exchange interface, and on the the driver side of the akcipher, the implementations would overload the existing akcipher encrypt(), decrypt(), set_pub_key(), set_priv_key() methods and do what

Re: [PATCH] crypto: implement DH primitives under akcipher API

2016-03-07 Thread Tadeusz Struk
Hi Marcel, On 03/07/2016 02:29 PM, Marcel Holtmann wrote: >> In this way we can define a generic user side of the key exchange interface, >> > and on the the driver side of the akcipher, the implementations would >> > overload >> > the existing akcipher encrypt(), decrypt(), set_pub_key(),

Re: [PATCH] crypto: implement DH primitives under akcipher API

2016-03-07 Thread Marcel Holtmann
Hi Tadeusz, >> And I have the feeling that akcipher is not the best approach for adding a >> key exchange method. I think we need a new method for doing exactly that. At >> the base of it, the key exchange is fundamentally different. > > It is unfortunate that, unlike the symmetric ciphers,

Re: [PATCH] crypto: implement DH primitives under akcipher API

2016-03-02 Thread Marcel Holtmann
Hi Stephan, >>> +static int dh_check_params_length(unsigned int p_len) >>> +{ >>> + switch (p_len) { >>> + case 768: >>> + case 1024: >>> + case 1536: >>> + case 2048: >>> + case 3072: >>> + case 4096: >>> +

Re: [PATCH] crypto: implement DH primitives under akcipher API

2016-03-02 Thread Stephan Mueller
Am Mittwoch, 2. März 2016, 08:03:44 schrieb Sandy Harris: Hi Sandy, > Salvatore Benedetto wrote: > >> > > > +static int dh_check_params_length(unsigned int p_len) > >> > > > +{ > >> > > > + switch (p_len) { > >> > > > + case 768: > >> > > > +

Re: [PATCH] crypto: implement DH primitives under akcipher API

2016-03-02 Thread Marcel Holtmann
Hi Salvatore, >>> Implement Diffie-Hellman primitives required by the scheme under the >>> akcipher API. Here is how it works. >>> 1) Call set_pub_key() by passing DH parameters (p,g) in PKCS3 format >>> 2) Call set_priv_key() to set your own private key (xa) in raw format >> >> this combination

Re: [PATCH] crypto: implement DH primitives under akcipher API

2016-03-02 Thread Sandy Harris
Salvatore Benedetto wrote: >> > > > +static int dh_check_params_length(unsigned int p_len) >> > > > +{ >> > > > + switch (p_len) { >> > > > + case 768: >> > > > + case 1024: >> > > > + case 1536: >> > > > + case 2048: >> > > > +

Re: [PATCH] crypto: implement DH primitives under akcipher API

2016-03-02 Thread Salvatore Benedetto
On Tue, Mar 01, 2016 at 12:25:33PM -0800, Marcel Holtmann wrote: Hi Marcel, > Hi Salvatore, > > > Implement Diffie-Hellman primitives required by the scheme under the > > akcipher API. Here is how it works. > > 1) Call set_pub_key() by passing DH parameters (p,g) in PKCS3 format > > 2) Call

Re: [PATCH] crypto: implement DH primitives under akcipher API

2016-03-01 Thread Marcel Holtmann
Hi Salvatore, > Implement Diffie-Hellman primitives required by the scheme under the > akcipher API. Here is how it works. > 1) Call set_pub_key() by passing DH parameters (p,g) in PKCS3 format > 2) Call set_priv_key() to set your own private key (xa) in raw format this combination seems odd

Re: [PATCH] crypto: implement DH primitives under akcipher API

2016-03-01 Thread Stephan Mueller
Am Dienstag, 1. März 2016, 11:08:34 schrieb Salvatore Benedetto: Hi Salvatore, > > > +static int dh_check_params_length(unsigned int p_len) > > > +{ > > > + switch (p_len) { > > > + case 768: > > > + case 1024: > > > + case 1536: > > > + case 2048: > > > + case 3072: > > > + case 4096: > > > +

Re: [PATCH] crypto: implement DH primitives under akcipher API

2016-03-01 Thread Salvatore Benedetto
Hi Stephan, thanks for reviewing. On Mon, Feb 15, 2016 at 02:57:08PM +0100, Stephan Mueller wrote: > Am Montag, 15. Februar 2016, 09:01:55 schrieb Salvatore Benedetto: > > Hi Salvatore, Herbert, > > > Implement Diffie-Hellman primitives required by the scheme under the > > akcipher API. Here

Re: [PATCH] crypto: implement DH primitives under akcipher API

2016-02-16 Thread Tadeusz Struk
On 02/16/2016 12:19 PM, Herbert Xu wrote: > On Mon, Feb 15, 2016 at 09:01:55AM +, Salvatore Benedetto wrote: >> > Implement Diffie-Hellman primitives required by the scheme under the >> > akcipher API. Here is how it works. >> > 1) Call set_pub_key() by passing DH parameters (p,g) in PKCS3

Re: [PATCH] crypto: implement DH primitives under akcipher API

2016-02-16 Thread Herbert Xu
On Mon, Feb 15, 2016 at 09:01:55AM +, Salvatore Benedetto wrote: > Implement Diffie-Hellman primitives required by the scheme under the > akcipher API. Here is how it works. > 1) Call set_pub_key() by passing DH parameters (p,g) in PKCS3 format > 2) Call set_priv_key() to set your own private

Re: [PATCH] crypto: implement DH primitives under akcipher API

2016-02-15 Thread Stephan Mueller
Am Montag, 15. Februar 2016, 09:01:55 schrieb Salvatore Benedetto: Hi Salvatore, Herbert, > Implement Diffie-Hellman primitives required by the scheme under the > akcipher API. Here is how it works. > 1) Call set_pub_key() by passing DH parameters (p,g) in PKCS3 format > 2) Call set_priv_key()