Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp918440ybp; Fri, 4 Oct 2019 07:02:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGdq9ZbOVQ4lM1/ZrXR20LDWLaZoql3VNPCX9nmIKntWDBEOGtWqR51lR961iyXxopjHs9 X-Received: by 2002:a17:906:6d53:: with SMTP id a19mr12368507ejt.144.1570197772505; Fri, 04 Oct 2019 07:02:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570197772; cv=none; d=google.com; s=arc-20160816; b=e+B4Wq6c58aKdDn+XR6vIk7g89AP7IK5P333IP67iyljAvO/f5WaA5RVdlWyUfUu0t 1SXSRxLye9cl2OvfCOt6Ygm6gzy7Te7pdszmVr4Xf902SXBI2nAs13G9i3uaHWOMssho 7u4nSe00EZMCR4n/rVFiKfenQuViE8JHY9HlNS49xsKrTiWgntXpox7Y5i/Yn5aYpNTW mhJNyviB0g+uRk8CQ1dTf4UZhZeg/NyHqpI4IYBIc8NKAgSQY30ybTMKt4BJl3p7zBS3 5BP/cPF8NbAIa/3Vylt3jP8kvnO8kHKUm/g373k7FkraPt0TJdEcfv+BD9KO251jWVJZ tarA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=hnu8EnpT5anwwGY4f9m2QeRBwIN3cBBLt/RxRLHGeh0=; b=GRNH30kpa1I53kNPQ8OmOtU6E5obBNeg4ViiweQ6UKttNWtEcOTj5grDryAkkwTWz2 PBvANeJ8b8XxJAhLz0LeM4V5LDYDE4Z7D2q4cCILf59xhLSzDh07GBB2ib36he4cF9lw RpbexsY5q6USA+uF1wpuVKEl1ty6jugbht1ONkoOXkklCeBBQGN9s5b2NMqxBx3IqJRs ZsC5xqT+9+P1M/XfaSf1V+2+G/xAkDodbw18GIKNui79Jc68Oa4w+CLXFxAbQIExk+4m hsQBBGBKCwAQT3QNoZYCMnIawB9g8k5uHDFOw7awZIU+Dj/fvTb4yx/SrvpPTBFi4579 KAAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=m83opc3T; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 w11si2945350eji.160.2019.10.04.07.02.26; Fri, 04 Oct 2019 07:02:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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=m83opc3T; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 S2389039AbfJDOBF (ORCPT + 99 others); Fri, 4 Oct 2019 10:01:05 -0400 Received: from frisell.zx2c4.com ([192.95.5.64]:54599 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388417AbfJDOBF (ORCPT ); Fri, 4 Oct 2019 10:01:05 -0400 Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 684a1077; Fri, 4 Oct 2019 13:14:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=date:from:to :cc:subject:message-id:references:mime-version:content-type :in-reply-to; s=mail; bh=pE4whhF1RHvIuHUbJe/EDlxqfZg=; b=m83opc3 T/n0LM8cUqfND7dsNHp/h/JdHn67Z6IYtrrotfRg9KCioQbLbjzzaTxgYPF5naNx SSQSesvIByC0y7iVH3z98fyCXfOHi8X77ZxU3OuVna87x0I6nBEupo+Daq2rVCkt y5//abKYVGokYCqlFeQqudmMu7jUBIpvQIBSYwju87afjkZGzn3Ei6hCKY0iA5Wb xAzwuIWXe0GHwX6E7k/rWj8biZix0z+hXRIJr76sQNWX8bDTxwVDpaQ8lF/JG9nX kK3nwkSCSaT/Jj8dxmWjvWZ0gn3XEdR9HpFuEVN3sRTu8hHuep6HcO6ZAQyEaIr9 GDBdfQxiFdaEnSQ== Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id c7e08c3e (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Fri, 4 Oct 2019 13:14:09 +0000 (UTC) Date: Fri, 4 Oct 2019 16:00:57 +0200 From: "Jason A. Donenfeld" To: Ard Biesheuvel Cc: linux-crypto@vger.kernel.org, Herbert Xu , David Miller , Greg KH , Linus Torvalds , Samuel Neves , Dan Carpenter , Arnd Bergmann , Eric Biggers , Andy Lutomirski , Will Deacon , Marc Zyngier , Catalin Marinas , Martin Willi , Peter Zijlstra , Josh Poimboeuf Subject: Re: [PATCH v2 18/20] crypto: arm/Curve25519 - wire up NEON implementation Message-ID: <20191004140057.GB114360@zx2c4.com> References: <20191002141713.31189-1-ard.biesheuvel@linaro.org> <20191002141713.31189-19-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191002141713.31189-19-ard.biesheuvel@linaro.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Oct 02, 2019 at 04:17:11PM +0200, Ard Biesheuvel wrote: > +bool curve25519_arch(u8 out[CURVE25519_KEY_SIZE], > + const u8 scalar[CURVE25519_KEY_SIZE], > + const u8 point[CURVE25519_KEY_SIZE]) > +{ > + if (!have_neon || !crypto_simd_usable()) > + return false; > + kernel_neon_begin(); > + curve25519_neon(out, scalar, point); > + kernel_neon_end(); > + return true; > +} > +EXPORT_SYMBOL(curve25519_arch); This now looks more like the Zinc way of doing things, with the _arch function returning true or false based on whether or not the implementation was available, allowing the generic implementation to run. I thought, from looking at the chacha commits earlier, you had done away with that style of things in favor of weak symbols, whereby the arch implementation would fall back to the generic one, instead of the other way around?