From patchwork Fri Jun 24 06:06:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salvatore Benedetto X-Patchwork-Id: 9196705 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6E7746075F for ; Fri, 24 Jun 2016 06:06:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6044228497 for ; Fri, 24 Jun 2016 06:06:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5498828499; Fri, 24 Jun 2016 06:06:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C765828497 for ; Fri, 24 Jun 2016 06:06:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751626AbcFXGGv (ORCPT ); Fri, 24 Jun 2016 02:06:51 -0400 Received: from mga04.intel.com ([192.55.52.120]:10411 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751616AbcFXGGt (ORCPT ); Fri, 24 Jun 2016 02:06:49 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP; 23 Jun 2016 23:06:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,518,1459839600"; d="scan'208";a="982370117" Received: from sie-lab-213-110.ir.intel.com (HELO localhost) ([10.237.213.110]) by orsmga001.jf.intel.com with ESMTP; 23 Jun 2016 23:06:47 -0700 Date: Fri, 24 Jun 2016 07:06:49 +0100 From: Salvatore Benedetto To: kbuild test robot , herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, salvatore.benedetto@intel.com Subject: Re: [cryptodev:master 79/79] (.text+0x330de0): multiple definition of `ecdh_shared_secret' Message-ID: <20160624060649.GA21165@localhost> References: <201606240302.rtIGIxRf%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201606240302.rtIGIxRf%fengguang.wu@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Jun 24, 2016 at 03:47:04AM +0800, kbuild test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master > head: 3c4b23901a0c766879dff680cd6bdab47bcdbbd2 > commit: 3c4b23901a0c766879dff680cd6bdab47bcdbbd2 [79/79] crypto: ecdh - Add ECDH software support > config: i386-allyesconfig (attached as .config) > compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430 > reproduce: > git checkout 3c4b23901a0c766879dff680cd6bdab47bcdbbd2 > # save the attached .config to linux build tree > make ARCH=i386 > > All errors (new ones prefixed by >>): > > net/built-in.o: In function `ecdh_shared_secret': > >> (.text+0x330de0): multiple definition of `ecdh_shared_secret' > crypto/built-in.o:(.text+0xb1b0): first defined here > > --- > 0-DAY kernel test infrastructure Open Source Technology Center > https://lists.01.org/pipermail/kbuild-all Intel Corporation Hi Herbert, can you squash the following patch? Thanks, Salvatore ---8<--- Rename ecdh_shared_secret Signed-off-by: Salvatore Benedetto --- crypto/ecc.c | 8 ++++---- crypto/ecc.h | 12 ++++++------ crypto/ecdh.c | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/crypto/ecc.c b/crypto/ecc.c index 9aedec6..1ba2436 100644 --- a/crypto/ecc.c +++ b/crypto/ecc.c @@ -966,10 +966,10 @@ out: return ret; } -int ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits, - const u8 *private_key, unsigned int private_key_len, - const u8 *public_key, unsigned int public_key_len, - u8 *secret, unsigned int secret_len) +int ecdh_compute_ss(unsigned int curve_id, unsigned int ndigits, + const u8 *private_key, unsigned int private_key_len, + const u8 *public_key, unsigned int public_key_len, + u8 *secret, unsigned int secret_len) { int ret = 0; struct ecc_point *product, *pk; diff --git a/crypto/ecc.h b/crypto/ecc.h index b5db4b9..a856175 100644 --- a/crypto/ecc.h +++ b/crypto/ecc.h @@ -60,7 +60,7 @@ int ecdh_make_pub_key(const unsigned int curve_id, unsigned int ndigits, u8 *public_key, unsigned int public_key_len); /** - * ecdh_shared_secret() - Compute a shared secret + * ecdh_compute_ss() - Compute a shared secret * * @curve_id: id representing the curve to use * @private_key: private key of part A @@ -70,14 +70,14 @@ int ecdh_make_pub_key(const unsigned int curve_id, unsigned int ndigits, * @secret: buffer for storing the calculated shared secret * @secret_len: length of the secret buffer * - * Note: It is recommended that you hash the result of ecdh_shared_secret + * Note: It is recommended that you hash the result of ecdh_compute_ss * before using it for symmetric encryption or HMAC. * * Returns 0 if the shared secret was generated successfully, a negative value * if an error occurred. */ -int ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits, - const u8 *private_key, unsigned int private_key_len, - const u8 *public_key, unsigned int public_key_len, - u8 *secret, unsigned int secret_len); +int ecdh_compute_ss(unsigned int curve_id, unsigned int ndigits, + const u8 *private_key, unsigned int private_key_len, + const u8 *public_key, unsigned int public_key_len, + u8 *secret, unsigned int secret_len); #endif diff --git a/crypto/ecdh.c b/crypto/ecdh.c index d3a9eec..7e12a34 100644 --- a/crypto/ecdh.c +++ b/crypto/ecdh.c @@ -79,10 +79,10 @@ static int ecdh_compute_value(struct kpp_request *req) if (copied != 2 * nbytes) return -EINVAL; - ret = ecdh_shared_secret(ctx->curve_id, ctx->ndigits, - (const u8 *)ctx->private_key, nbytes, - (const u8 *)ctx->public_key, 2 * nbytes, - (u8 *)ctx->shared_secret, nbytes); + ret = ecdh_compute_ss(ctx->curve_id, ctx->ndigits, + (const u8 *)ctx->private_key, nbytes, + (const u8 *)ctx->public_key, 2 * nbytes, + (u8 *)ctx->shared_secret, nbytes); buf = ctx->shared_secret; } else {