From patchwork Wed Dec 11 09:26:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason A. Donenfeld" X-Patchwork-Id: 181192 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp280640ile; Wed, 11 Dec 2019 01:27:39 -0800 (PST) X-Google-Smtp-Source: APXvYqxkm1NqsvwZ9bVzZdrPb7rlYY6whoHxkhSZ1WseLQxMwxI5tTpuAFfItuLxqqsOMpuZHIkU X-Received: by 2002:a05:6830:1608:: with SMTP id g8mr1465031otr.169.1576056459886; Wed, 11 Dec 2019 01:27:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576056459; cv=none; d=google.com; s=arc-20160816; b=mxLgPl6Qrs8+FnL3H3VBkMDe6ZM5/o9WI1m91+yXS9UloGvzSCFiRXoZlFbo7e1vtT tg/n5a21so5VxqP2z18UaTL+SH/nZmojdMbjTFwcuJNPv62cS+CUcTy76FaaR0v+anQi PqNVqGdqFjhvxw4RYq07TFaF4g+KtfrUJ7A7odoBHkVHqlWPZ9ctzpnP6y94/8UVjERV izNX54HO3xLg0HE8it7AXB/U9vfPIRoGqCt/yw3LqFyli3AmfNmO2JIe4Ljl+v6PIbB5 FrxhDRijAFKUuJhh38lbeCc/7auf0TNe9zULzFOS+CTlOr1Tg7Tq2siUw9JmaeRW9k5z WjnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9cKlooO+hEyuP7kTaEMcFssH5hOMYP54gSkR+SIhir0=; b=Rmd6M17MhOqupKMfvRYarVaOp6pXLMAUZDwAHdtEpOD85wamKNLx0w/Vb2O953Okx2 KiWC2PJ6mEnsRv7O8bfN7+vMkjDEWbrcYtNzBSWBtvqk2i0uFwbfBsrdilKj+AI3f+nx Vs5uQyneD/F3LUM6WFRJ3dbpYg+qlphzt4zEkPK5Qd1YQ9LCgxL7cNverygpv3D86d+J lSrFd6sgLarNFzG6SC8ylS+xtsaPd7xRhpwJLothWa3Nld41XtZWSwB9izzyU+P6IF6a J/sSHKrE+CJuff+3LGco8FR8tQd/PqozsVUrqMgtzZnMAlkxbgWmc+65RWcN+koA9ygE l4Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=KLDm1GD3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v21si689142otn.8.2019.12.11.01.27.39; Wed, 11 Dec 2019 01:27:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=KLDm1GD3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728508AbfLKJ1i (ORCPT + 27 others); Wed, 11 Dec 2019 04:27:38 -0500 Received: from frisell.zx2c4.com ([192.95.5.64]:34217 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727493AbfLKJ1h (ORCPT ); Wed, 11 Dec 2019 04:27:37 -0500 Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id d86f8824; Wed, 11 Dec 2019 08:31:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=mail; bh=//5qwTghPPq3ufYyCtI8PBz0K x8=; b=KLDm1GD3JIdDKDUXiPHEPQcvixQk9WfLbj2Y+DiR5sK4oiLOptHs3gK9c xxhVl98rnkkql6T71wweePWc5DypqU3KeNK+hrJvpNZNyvulHos+jUOS1nI9pvtB TGX6lUvHihaJCuuEuAoAV/kQCIN57mH62mLRMJQuv13c2jsU61YslYnFsCevKTRF 8azP/hREllsyrzApWwJC7pGgNCWtJwd3SpVBdxGTGt6cLLGxSi6TsW8W3SoHCDcz IRjnFj/aaubEa44LmAiZShluxipse3l8f48NOhnK1X6FvFucxoAxBytByWNLiyNF uxt8OGP347CxHqhHlKaWGrgkxMr9Q== Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 6aaa56e1 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Wed, 11 Dec 2019 08:31:56 +0000 (UTC) From: "Jason A. Donenfeld" To: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, sfr@canb.auug.org.au, "Jason A. Donenfeld" Subject: [PATCH 1/2] crypto: arm/curve25519 - add arch-specific key generation function Date: Wed, 11 Dec 2019 10:26:39 +0100 Message-Id: <20191211092640.107621-1-Jason@zx2c4.com> In-Reply-To: <20191211102455.7b55218e@canb.auug.org.au> References: <20191211102455.7b55218e@canb.auug.org.au> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Somehow this was forgotten when Zinc was being split into oddly shaped pieces, resulting in linker errors. The x86_64 glue has a specific key generation implementation, but the Arm one does not. However, it can still receive the NEON speedups by calling the ordinary DH function using the base point. Signed-off-by: Jason A. Donenfeld --- arch/arm/crypto/curve25519-glue.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.24.0 Acked-by: Ard Biesheuvel diff --git a/arch/arm/crypto/curve25519-glue.c b/arch/arm/crypto/curve25519-glue.c index f3f42cf3b893..776ae07e0469 100644 --- a/arch/arm/crypto/curve25519-glue.c +++ b/arch/arm/crypto/curve25519-glue.c @@ -38,6 +38,13 @@ void curve25519_arch(u8 out[CURVE25519_KEY_SIZE], } EXPORT_SYMBOL(curve25519_arch); +void curve25519_base_arch(u8 pub[CURVE25519_KEY_SIZE], + const u8 secret[CURVE25519_KEY_SIZE]) +{ + return curve25519_arch(pub, secret, curve25519_base_point); +} +EXPORT_SYMBOL(curve25519_base_arch); + static int curve25519_set_secret(struct crypto_kpp *tfm, const void *buf, unsigned int len) {