From patchwork Wed Sep 25 16:12:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 174371 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp842970ill; Wed, 25 Sep 2019 09:14:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNkE08NQsJ1D6yF3s6NsQ1uapAHzzghJs/hUU4cPMhi/Nk6lrUKJXEMg0qER3rVldakR0W X-Received: by 2002:a50:8d5e:: with SMTP id t30mr3883882edt.112.1569428043504; Wed, 25 Sep 2019 09:14:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569428043; cv=none; d=google.com; s=arc-20160816; b=hA3wFoU5hFPbSrNwG9tMTvi/Uz62aw7fgy/sYYj/d1zfWJF9HnyFOxkGpmgwf1uTYI pkmOcl2fmoHdNU11q7Q8BVuDlwuP7TCyk01sDr2lqJoWa2hO4g2fBmQwooj10hkETdSy I8d5a2mqcmeyPZ55HuFuunkJah6lqd7ULGjGqecWDoShEaumkhFfDq5CVjk7Spyx/p9k IZEw2hxXpCa6qx6StHAEA2YqDv62G5kgcX6neRZ0GZCKHpLBbIDyzBioARRGkuevhYnm 8ioLKsFWSb9dtmhNwa7pfqLXInSCknzOhSugyuyGOaztDzXQXEt2WSW+w27T7yyk7/Dh GRKQ== 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=oTkLJDHd3Opt8Q7gQbNEv9bluAfNAUwUozJN7kv8cIw=; b=0vt4jSQntxvrdJM9MYn5iWXDAICN7r77E2WBZSR8Q70lTvUzyMhAo7pNifFQPgQdPL /FoMTc3eliiPYDtwaGD3RxxxvlliJHx0/M9T4ENsDB6c0s1XekyErRISpWawcRFwtXM2 M8r76K180Af/ZHqFjN6xVarYhtsN5UznbQvuXFeg3EHPlJmgW6CLwsTvQ0vXnw+9WLHS pgzltQWYQCw6CnYbGUib2KocIsn4BgJqtSRPLSHaOLbagfMZ2YPwW5VNBVs0O3Fv/h/F 40+8owNLybm7+K4MQktObk7dgeBq3O9juY3jehfhc88FbefSP9tetIgrClstv71T6j51 5iVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yF7nxogd; 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 g18si3540139edq.209.2019.09.25.09.14.03; Wed, 25 Sep 2019 09:14:03 -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=yF7nxogd; 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 S2387908AbfIYQOB (ORCPT + 3 others); Wed, 25 Sep 2019 12:14:01 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:37510 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388006AbfIYQOA (ORCPT ); Wed, 25 Sep 2019 12:14:00 -0400 Received: by mail-wr1-f66.google.com with SMTP id i1so7651741wro.4 for ; Wed, 25 Sep 2019 09:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oTkLJDHd3Opt8Q7gQbNEv9bluAfNAUwUozJN7kv8cIw=; b=yF7nxogdOddiZ7APJUWvv8ZOZvf7wdIBsXoh5+aa06OqQerRa+w3xtndhPDTvbyeTs SxCDjPcJJ5qj5HXRHMljeXqQhUcT5u8DVC/xiVUQWc/xL7+i5gE2JMdr8DvOBarsLX5B EawpOjrIVlrozZgzbaV+7ympMMIMlrDR+vcF8xD93tAcRteh3dAQUd6LOhepRf1abFOU kJvyoTfNL3aOgWUg9OLo15VCRpFO8RzefWgCE9X6Zu++89AoZlW3h1MyeCH2qsIp0cPV P92XYhzshGFCxB/VVpNrKiPnXbbjfbGLkRrHxm15wdGgtvLZ667XLMgIGKtHMIEw6LVd 7teg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oTkLJDHd3Opt8Q7gQbNEv9bluAfNAUwUozJN7kv8cIw=; b=NFWAPvlOEnRU3ufsXJryyN9+icRPQWfy9oW4RcXrWvf34v/yw6JolvaVJr9Kek4Xgv dDIHoJ4ePqLoigR3+wnxkPQ1hnWLHn5mzacU7Nqdsz+ywfNSCUAfQ3MxXbwP/zpkRy29 SELPAochuazjR68ZGIh6wBTECnp8BrC5bc1AxFudgZ1RfAB7mVIiCth7Mq7SZSg2+EBO UhYPmm3tk5E7wszPmQrtDqQsiR3KuNkwxiYC3zmDtRVfmvScrDtcJ/ASdnb3nQ0mYpl2 /YvwS1dPXB/4zsf7+DDWcP2mUpL0b2ddVLLBYbN/g65qdL9B6m6vISBiU5MAFvOqoF7V /JCg== X-Gm-Message-State: APjAAAWNsR75aOYmjBuv3UyHGfxK+pbN8XFL/zJN/0xJB6cRyzolskrD 6nXUUtY90U+GTczr/Nxa3Z7V9VCjV4Ouscyu X-Received: by 2002:adf:afed:: with SMTP id y45mr10259853wrd.347.1569428038355; Wed, 25 Sep 2019 09:13:58 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-657-1-83-120.w92-154.abo.wanadoo.fr. [92.154.90.120]) by smtp.gmail.com with ESMTPSA id o70sm4991085wme.29.2019.09.25.09.13.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 09:13:57 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Herbert Xu , David Miller , Greg KH , Linus Torvalds , "Jason A . Donenfeld" , Samuel Neves , Dan Carpenter , Arnd Bergmann , Eric Biggers , Andy Lutomirski , Will Deacon , Marc Zyngier , Catalin Marinas Subject: [RFC PATCH 08/18] crypto: testmgr - add a chacha20poly1305 test case Date: Wed, 25 Sep 2019 18:12:45 +0200 Message-Id: <20190925161255.1871-9-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190925161255.1871-1-ard.biesheuvel@linaro.org> References: <20190925161255.1871-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Add a test case to the RFC7539 (non-ESP) test vector array that exercises the newly added code path that may optimize away one invocation of the shash when the assoclen is a multiple of the Poly1305 block size. Signed-off-by: Ard Biesheuvel --- crypto/testmgr.h | 45 ++++++++++++++++++++ 1 file changed, 45 insertions(+) -- 2.20.1 diff --git a/crypto/testmgr.h b/crypto/testmgr.h index ef7d21f39d4a..5439b37f2b9f 100644 --- a/crypto/testmgr.h +++ b/crypto/testmgr.h @@ -18950,6 +18950,51 @@ static const struct aead_testvec rfc7539_tv_template[] = { "\x22\x39\x23\x36\xfe\xa1\x85\x1f" "\x38", .clen = 281, + }, { + .key = "\x80\x81\x82\x83\x84\x85\x86\x87" + "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f" + "\x90\x91\x92\x93\x94\x95\x96\x97" + "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", + .klen = 32, + .iv = "\x07\x00\x00\x00\x40\x41\x42\x43" + "\x44\x45\x46\x47", + .assoc = "\x50\x51\x52\x53\xc0\xc1\xc2\xc3" + "\xc4\xc5\xc6\xc7\x44\x45\x46\x47", + .alen = 16, + .ptext = "\x4c\x61\x64\x69\x65\x73\x20\x61" + "\x6e\x64\x20\x47\x65\x6e\x74\x6c" + "\x65\x6d\x65\x6e\x20\x6f\x66\x20" + "\x74\x68\x65\x20\x63\x6c\x61\x73" + "\x73\x20\x6f\x66\x20\x27\x39\x39" + "\x3a\x20\x49\x66\x20\x49\x20\x63" + "\x6f\x75\x6c\x64\x20\x6f\x66\x66" + "\x65\x72\x20\x79\x6f\x75\x20\x6f" + "\x6e\x6c\x79\x20\x6f\x6e\x65\x20" + "\x74\x69\x70\x20\x66\x6f\x72\x20" + "\x74\x68\x65\x20\x66\x75\x74\x75" + "\x72\x65\x2c\x20\x73\x75\x6e\x73" + "\x63\x72\x65\x65\x6e\x20\x77\x6f" + "\x75\x6c\x64\x20\x62\x65\x20\x69" + "\x74\x2e", + .plen = 114, + .ctext = "\xd3\x1a\x8d\x34\x64\x8e\x60\xdb" + "\x7b\x86\xaf\xbc\x53\xef\x7e\xc2" + "\xa4\xad\xed\x51\x29\x6e\x08\xfe" + "\xa9\xe2\xb5\xa7\x36\xee\x62\xd6" + "\x3d\xbe\xa4\x5e\x8c\xa9\x67\x12" + "\x82\xfa\xfb\x69\xda\x92\x72\x8b" + "\x1a\x71\xde\x0a\x9e\x06\x0b\x29" + "\x05\xd6\xa5\xb6\x7e\xcd\x3b\x36" + "\x92\xdd\xbd\x7f\x2d\x77\x8b\x8c" + "\x98\x03\xae\xe3\x28\x09\x1b\x58" + "\xfa\xb3\x24\xe4\xfa\xd6\x75\x94" + "\x55\x85\x80\x8b\x48\x31\xd7\xbc" + "\x3f\xf4\xde\xf0\x8e\x4b\x7a\x9d" + "\xe5\x76\xd2\x65\x86\xce\xc6\x4b" + "\x61\x16\xb3\xb8\x82\x76\x1f\x39" + "\x35\x6f\x26\x8d\x28\x0f\xac\x45" + "\x02\x5d", + .clen = 130, }, };