> -----Original Message----- > From: Herbert Xu [mailto:herbert@xxxxxxxxxxxxxxxxxxx] > Sent: Monday, June 20, 2016 12:15 PM > To: Benedetto, Salvatore <salvatore.benedetto@xxxxxxxxx> > Cc: linux-crypto@xxxxxxxxxxxxxxx > Subject: Re: [PATCH v9 2/3] crypto: kpp - Add DH software implementation > > On Fri, Jun 17, 2016 at 03:37:44PM +0100, Salvatore Benedetto wrote: > > * Implement MPI based Diffie-Hellman under kpp API > > > > +struct dh { > > + void *key; > > + void *p; > > + void *g; > > + unsigned int key_size; > > + unsigned int p_size; > > + unsigned int g_size; > > +}; > > + > > +int crypto_dh_key_len(const struct dh *params); int > > +crypto_dh_encode_key(char *buf, unsigned int len, const struct dh > > +*params); int crypto_dh_decode_key(const char *buf, unsigned int len, > > +struct dh **params); > > While you're at it, it would be nice if you could make the encoded format > little-endian, that way we can make test vectors for all kpp algorithms use > the same format. > The input format is the same for DH and ECDH. Only the software implementation of ECC requires little-endian format. Regards, Salvatore > Thanks, > -- > Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: > http://gondor.apana.org.au/~herbert/ > PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html