Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp2171242ybn; Thu, 26 Sep 2019 08:02:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+u/Yt8c5L+khM/ntiR4OTUKJt8Faxam9LXgE4TQc70oJOGCIa702P3hCtYPnhzemqnE9E X-Received: by 2002:a50:f19c:: with SMTP id x28mr4118818edl.42.1569510178225; Thu, 26 Sep 2019 08:02:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569510178; cv=none; d=google.com; s=arc-20160816; b=LNioc7mGxYsYTbfkoxe73HvhV6tnclzMYkU8zqoSunqeOkFkc69jdDekhZCQn6AjWo Xettj9OpvUROQ9RjdS4AW98DtbB1KejToqdw/CIbbsr9LaOoi3P1N5XJVi+9UlHZ11DF Qw4uxshamydxhFJzJlloC7DXSy0zrL8/ASD/jbfCO6x+cY0GO+V65FkkroZ45lpugstG PGDy/eOZUrvxNnVTKAKkwahFu7iX5jYTuUwegs83nuf+jEJcO8/v9oRztp8aN1J3Wb9K eETpqBtB49de1DrjIfhnIQvUvuueF2x2vH4KM2rp0ZG8Mn/ANmx+nU5VFtCYRHm+dbz7 8mvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JyVaqaZ193HlGyEuM1IPz/iYFAXNi/CM2xxL+aWnNWs=; b=qc0ATs8Mqr4X+qGUDQjW/TJV3ulq8lrhwHLODFDipwxzgcDlewovKD8X3FGIH4VtdC dzquJ9VuuZVxW1IDZROQy8XUBUYW0ZC+nCpJm2FcDkfrmyvcctICbaRo/SpNop+qTRGk 3lkx28Lt2YqaXl6QdIF2UxVoqlqel48kQ1AAQTdRMhZgOHV/MZkZH7SziFoqfzh5NpsR eHN3ckvfgu8bns3BF43nLru2zANdbUtw/ELxfKgH7HoN2eMNvzbYSajErLSPJb0m1qh6 1JpoVejQ6iIeEmSMaDCZIyo6UgpzwRYRfTFWfyWsM0sDlSOpuHhxUzwq/8fk2YU2bHTp XDjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cbrHpAea; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q17si1166501ejx.139.2019.09.26.08.02.28; Thu, 26 Sep 2019 08:02:58 -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=@linaro.org header.s=google header.b=cbrHpAea; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727213AbfIZO7g (ORCPT + 99 others); Thu, 26 Sep 2019 10:59:36 -0400 Received: from mail-wr1-f48.google.com ([209.85.221.48]:37654 "EHLO mail-wr1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725917AbfIZO7g (ORCPT ); Thu, 26 Sep 2019 10:59:36 -0400 Received: by mail-wr1-f48.google.com with SMTP id i1so3161998wro.4 for ; Thu, 26 Sep 2019 07:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JyVaqaZ193HlGyEuM1IPz/iYFAXNi/CM2xxL+aWnNWs=; b=cbrHpAeanzc0/KwZKxx6xOp2/hXya7Uy2dKk4WdD1cnlxe3B9WOVYy2tYSRDsK7SCW Tr+61trJ0bVhDdahZdNfSFP5Wx9SJWK2ai7xVwUo1Hm74fuWl9S+k7X6cqGebgR1s/2Z pFU3uodgfOc491EruFKE7PCv/rn4ZpcbRrxnyDNHRv7wmm1UZ5xfuf2OWnurD1YPX36s kNfQ1UdNB2YVYJpfzJDFdYVq/A7YCMqcvNxojbMoMNfwFNr86Vny7lzfDB6bNlY+t9VH f1b6a+kwLagX7WBbpzYgUbgZLznuTuFJGEMFLwJCHUzeaCCMUrhNLA8DM1iAIP1P/Xqf R0gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JyVaqaZ193HlGyEuM1IPz/iYFAXNi/CM2xxL+aWnNWs=; b=FKxNYMQHkrq71b2/RoU7UQZ8y2JrS9nLKoAtHJ2pmYLLsvijA6sPEt7ZjIkwNTrqfS xiP4dtgMHcYob2yBzIaJjem3VUqkN5GoF3vuhiUik2Bry0o6LKo9zKgO3xJfy6fdqJE1 z7Bynk7jNXLvhKaowODtL5l4PH1uG32PLqfqAUmFlUYoVME8EvjPgX9T9HcyY4h3n2JZ pU5z2TMGyJvm78Yd/Fme1YSaN5x0qrkgWeP3YNtVgeAjEJoO/6ACO4jHyx2qd0zao5IO 0tfV8O63pD9HEL81PUuUqNBkFnztRaXSqUUqb2f2LIIjNs/EpVkUm8VOjkAHmEjs7Ldd /8xw== X-Gm-Message-State: APjAAAXmipIBgR2ud/U9F5UQbJVsf7Wdbuin/VXKX43BWUgy51ynKZh0 mhBQhMWiHphl07nujoCzHIYbR5dFkrazqZMLyt6x3A== X-Received: by 2002:adf:fe88:: with SMTP id l8mr3193714wrr.32.1569509973246; Thu, 26 Sep 2019 07:59:33 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ard Biesheuvel Date: Thu, 26 Sep 2019 16:59:22 +0200 Message-ID: Subject: Re: Chacha-Poly performance on ARM64 To: Pascal Van Leeuwen Cc: Linux Crypto Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, 26 Sep 2019 at 16:55, Pascal Van Leeuwen wrote: > > Hi, > > I'm currently doing some performance benchmarking on a quad core Cortex > A72 (Macchiatobin dev board) for rfc7539esp (ChachaPoly) and the > relatively low performance kind of took me by surprise, considering how > everyone keeps shouting how efficient Chacha-Poly is in software on > modern CPU's. > > Then I noticed that it was using chacha20-generic for the encrypt > direction, while a chacha20-neon implementation exists (it actually > DOES use that one for decryption). Why would that be? > > Also, it also uses poly1305-generic in both cases. Is that the best > possible on ARM64? I did a quick search in the codebase but couldn't > find any ARM64 optimized version ... > The Poly1305 implementation is part of the 18 piece WireGuard series I just sent out yesterday (which I know you have seen :-)) The Chacha20 code should be used in preference to the generic code, so if you end up with the wrong version, there's a bug somewhere we need to fix. Also, how do you know which direction uses which transform? What are the refcounts for the transforms in /proc/crypto?