From owner-dev-commits-src-main@freebsd.org Thu Apr 1 22:49:32 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C8A15B98DE; Thu, 1 Apr 2021 22:49:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FBJK770dvz3Cfj; Thu, 1 Apr 2021 22:49:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3B5A15428; Thu, 1 Apr 2021 22:49:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 131MnVZo081540; Thu, 1 Apr 2021 22:49:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 131MnVNt081539; Thu, 1 Apr 2021 22:49:31 GMT (envelope-from git) Date: Thu, 1 Apr 2021 22:49:31 GMT Message-Id: <202104012249.131MnVNt081539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: c86de1dab8e6 - main - cryptocheck: Expand the set of sizes tested by -z. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c86de1dab8e65bc9d11501ca51f2e152276cb94e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Apr 2021 22:49:32 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c86de1dab8e65bc9d11501ca51f2e152276cb94e commit c86de1dab8e65bc9d11501ca51f2e152276cb94e Author: John Baldwin AuthorDate: 2021-04-01 22:42:30 +0000 Commit: John Baldwin CommitDate: 2021-04-01 22:49:07 +0000 cryptocheck: Expand the set of sizes tested by -z. Test individual sizes up to the max encryption block length as well as a few sizes that include 1 full block and a partial block before doubling the size. Reviewed by: cem, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29518 --- tools/tools/crypto/cryptocheck.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/tools/crypto/cryptocheck.c b/tools/tools/crypto/cryptocheck.c index bd075d24e0f5..502ea04cd661 100644 --- a/tools/tools/crypto/cryptocheck.c +++ b/tools/tools/crypto/cryptocheck.c @@ -228,7 +228,7 @@ static const struct alg { static bool verbose; static int requested_crid; -static size_t aad_sizes[48], sizes[128]; +static size_t aad_sizes[48], sizes[EALG_MAX_BLOCK_LEN * 2]; static u_int naad_sizes, nsizes; static void @@ -1729,12 +1729,18 @@ main(int ac, char **av) if (nsizes == 0) { if (testall) { - for (i = 1; i <= 32; i++) { + for (i = 1; i <= EALG_MAX_BLOCK_LEN; i++) { sizes[nsizes] = i; nsizes++; } - base_size = 32; + for (i = EALG_MAX_BLOCK_LEN + 8; + i <= EALG_MAX_BLOCK_LEN * 2; i += 8) { + sizes[nsizes] = i; + nsizes++; + } + + base_size = EALG_MAX_BLOCK_LEN * 2; while (base_size * 2 < 240 * 1024) { base_size *= 2; assert(nsizes < nitems(sizes));