From: Herbert Xu Subject: Re: [PATCH v9 2/3] crypto: kpp - Add DH software implementation Date: Mon, 20 Jun 2016 19:15:24 +0800 Message-ID: <20160620111524.GB10601@gondor.apana.org.au> References: <1466174265-4546-1-git-send-email-salvatore.benedetto@intel.com> <1466174265-4546-3-git-send-email-salvatore.benedetto@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-crypto@vger.kernel.org To: Salvatore Benedetto Return-path: Received: from helcar.hengli.com.au ([209.40.204.226]:42085 "EHLO helcar.hengli.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753122AbcFTLPn (ORCPT ); Mon, 20 Jun 2016 07:15:43 -0400 Content-Disposition: inline In-Reply-To: <1466174265-4546-3-git-send-email-salvatore.benedetto@intel.com> Sender: linux-crypto-owner@vger.kernel.org List-ID: 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. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt