Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2183205/?format=api
{ "id": 2183205, "url": "http://patchwork.ozlabs.org/api/patches/2183205/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260112192035.10427-34-ebiggers@kernel.org/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<20260112192035.10427-34-ebiggers@kernel.org>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20260112192035.10427-34-ebiggers@kernel.org/", "date": "2026-01-12T19:20:31", "name": "[v2,33/35] lib/crypto: aesgcm: Use new AES library API", "commit_ref": null, "pull_url": null, "state": "handled-elsewhere", "archived": false, "hash": "960c7450e75a947be17fa8cf9e2f67ad732fd725", "submitter": { "id": 74690, "url": "http://patchwork.ozlabs.org/api/people/74690/?format=api", "name": "Eric Biggers", "email": "ebiggers@kernel.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260112192035.10427-34-ebiggers@kernel.org/mbox/", "series": [ { "id": 488089, "url": "http://patchwork.ozlabs.org/api/series/488089/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=488089", "date": "2026-01-12T19:19:58", "name": "AES library improvements", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/488089/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2183205/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2183205/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linuxppc-dev+bounces-15571-incoming=patchwork.ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=q3sNENqr;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:21b9:f100::1; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-15571-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)", "lists.ozlabs.org;\n arc=none smtp.remote-ip=172.234.252.31", "lists.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org", "lists.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=q3sNENqr;\n\tdkim-atps=neutral", "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org\n (client-ip=172.234.252.31; helo=sea.source.kernel.org;\n envelope-from=ebiggers@kernel.org; receiver=lists.ozlabs.org)" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org\n [IPv6:2404:9400:21b9:f100::1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4dqj5g5FT2z1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 13 Jan 2026 06:25:43 +1100 (AEDT)", "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4dqj3F5sp6z30Tc;\n\tTue, 13 Jan 2026 06:23:37 +1100 (AEDT)", "from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 4dqj3D3q7gz30Vw\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 13 Jan 2026 06:23:36 +1100 (AEDT)", "from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby sea.source.kernel.org (Postfix) with ESMTP id 3DCE344407;\n\tMon, 12 Jan 2026 19:23:36 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id ACBFBC2BCAF;\n\tMon, 12 Jan 2026 19:23:35 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1768245817;\n\tcv=none;\n b=QDaE+xNvWtSeD/7H3s6W2oizSeoD2A2pesWjm7ymBOwigw7031/cA0LXZViYJoIdAf3ygjXUut+f2vpfhK7asvO3gJ0S3a4Xr4z549Q6FbmA/N06w2zmrLR4Epb8hWkkYT9sb074f7ivV0JiTgg2Id//Ald835Zm+tUzAJ6BUt0B2P8TLFq0kzyIxB16RU00wcUngSeq7SwJjk2SbzSYKCwYLTOQXLWrTl1+yByXdY3v+crbDQFr7Mey0cW9t43PahGP8Rj6w33twgJsYLCNCfwMJAvyyTXCEenvb7jQYMW+R96nptFbsdGAbVOjQJEDYP6jOn0drztJi/U6xBbKqA==", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1768245817; c=relaxed/relaxed;\n\tbh=eotzGZuj6oHcNUoE65S+8YyxwiDDPFCNbNf8w4JzmKg=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=XFegiBFtZuCI/KnwjXWUqVV81daa4OMP9/3HxrwTRq1tnEF4AYj9NHiobxSH3a3v6SE+FjWvtH14r53NWkUBWeODSF+cwhSx6eJ99doddG918Rqk/cxTAIbhGrvh/LiXzBALAfoOE0M5mKXVGSyKwNt06bVfVfg8F32BjYQWqShToic+H5ds6L9pJJ+vY01ifEjoAfi4iiEJOzMcdbBjfQmiHD2AwdmGKtQ8jInlSNq+ej0qSmtphDkDIdFuMEDrmovKxSzPUSh+qYjvQSsZOKecXFpYz9rn3Q7L/IRQcB9e36U/d6s1Pa1mMubcCw4f9MUK0yR9erB0lZ+4dPydBA==", "ARC-Authentication-Results": "i=1; lists.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org;\n dkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=q3sNENqr; dkim-atps=neutral;\n spf=pass (client-ip=172.234.252.31; helo=sea.source.kernel.org;\n envelope-from=ebiggers@kernel.org;\n receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1768245816;\n\tbh=IaZD3/z0VruOzVsSeL0tDqsMVtMwLaUfDPIoikws89s=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=q3sNENqrqqcDO42H3lrCThh+O5h92X8jFa5+tyEgHLXYbkUrGuEi+TF4kolK1HG/M\n\t qRHleKOVc2gNdaCvzYJzBH4ip58WuHHubI/tDcfQz+bN8BQTD3AuPGgpYpmnkfcCuC\n\t 9aBq4nnn6tmgXqBvr+y2xAfXBUvB3wbLUai/RlUHDoVCdB3qck4LsjpoWvgk0se1sv\n\t MpKfr/zHghjuoNnlDAGcx2GhZ9jiA3JkayZabe8haqjO7Nu5GiqDiJb4KKi3aFOV32\n\t CwxqAWZ7bdKY6hmIG8H89AEmcRc6JM5eRVcDODpIIZWUiVvaFNRj1xe1wnIMiIG+7S\n\t a9PMzFVoUk01g==", "From": "Eric Biggers <ebiggers@kernel.org>", "To": "linux-crypto@vger.kernel.org", "Cc": "linux-kernel@vger.kernel.org,\n\tArd Biesheuvel <ardb@kernel.org>,\n\t\"Jason A . Donenfeld\" <Jason@zx2c4.com>,\n\tHerbert Xu <herbert@gondor.apana.org.au>,\n\tlinux-arm-kernel@lists.infradead.org,\n\tlinuxppc-dev@lists.ozlabs.org,\n\tlinux-riscv@lists.infradead.org,\n\tlinux-s390@vger.kernel.org,\n\tsparclinux@vger.kernel.org,\n\tx86@kernel.org,\n\tHolger Dengler <dengler@linux.ibm.com>,\n\tHarald Freudenberger <freude@linux.ibm.com>,\n\tEric Biggers <ebiggers@kernel.org>", "Subject": "[PATCH v2 33/35] lib/crypto: aesgcm: Use new AES library API", "Date": "Mon, 12 Jan 2026 11:20:31 -0800", "Message-ID": "<20260112192035.10427-34-ebiggers@kernel.org>", "X-Mailer": "git-send-email 2.52.0", "In-Reply-To": "<20260112192035.10427-1-ebiggers@kernel.org>", "References": "<20260112192035.10427-1-ebiggers@kernel.org>", "X-Mailing-List": "linuxppc-dev@lists.ozlabs.org", "List-Id": "<linuxppc-dev.lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev+help@lists.ozlabs.org>", "List-Owner": "<mailto:linuxppc-dev+owner@lists.ozlabs.org>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Archive": "<https://lore.kernel.org/linuxppc-dev/>,\n <https://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Subscribe": "<mailto:linuxppc-dev+subscribe@lists.ozlabs.org>,\n <mailto:linuxppc-dev+subscribe-digest@lists.ozlabs.org>,\n <mailto:linuxppc-dev+subscribe-nomail@lists.ozlabs.org>", "List-Unsubscribe": "<mailto:linuxppc-dev+unsubscribe@lists.ozlabs.org>", "Precedence": "list", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Spam-Status": "No, score=-0.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,\n\tDKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS\n\tautolearn=disabled version=4.0.1 OzLabs 8", "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on lists.ozlabs.org" }, "content": "Switch from the old AES library functions (which use struct\ncrypto_aes_ctx) to the new ones (which use struct aes_enckey). This\neliminates the unnecessary computation and caching of the decryption\nround keys. The new AES en/decryption functions are also much faster\nand use AES instructions when supported by the CPU.\n\nNote that in addition to the change in the key preparation function and\nthe key struct type itself, the change in the type of the key struct\nresults in aes_encrypt() (which is temporarily a type-generic macro)\ncalling the new encryption function rather than the old one.\n\nAcked-by: Ard Biesheuvel <ardb@kernel.org>\nSigned-off-by: Eric Biggers <ebiggers@kernel.org>\n---\n include/crypto/gcm.h | 2 +-\n lib/crypto/aesgcm.c | 12 ++++++------\n 2 files changed, 7 insertions(+), 7 deletions(-)", "diff": "diff --git a/include/crypto/gcm.h b/include/crypto/gcm.h\nindex fd9df607a836..b524e47bd4d0 100644\n--- a/include/crypto/gcm.h\n+++ b/include/crypto/gcm.h\n@@ -64,11 +64,11 @@ static inline int crypto_ipsec_check_assoclen(unsigned int assoclen)\n \treturn 0;\n }\n \n struct aesgcm_ctx {\n \tbe128\t\t\tghash_key;\n-\tstruct crypto_aes_ctx\taes_ctx;\n+\tstruct aes_enckey\taes_key;\n \tunsigned int\t\tauthsize;\n };\n \n int aesgcm_expandkey(struct aesgcm_ctx *ctx, const u8 *key,\n \t\t unsigned int keysize, unsigned int authsize);\ndiff --git a/lib/crypto/aesgcm.c b/lib/crypto/aesgcm.c\nindex ac0b2fcfd606..02f5b5f32c76 100644\n--- a/lib/crypto/aesgcm.c\n+++ b/lib/crypto/aesgcm.c\n@@ -10,11 +10,11 @@\n #include <crypto/ghash.h>\n #include <linux/export.h>\n #include <linux/module.h>\n #include <asm/irqflags.h>\n \n-static void aesgcm_encrypt_block(const struct crypto_aes_ctx *ctx, void *dst,\n+static void aesgcm_encrypt_block(const struct aes_enckey *key, void *dst,\n \t\t\t\t const void *src)\n {\n \tunsigned long flags;\n \n \t/*\n@@ -24,11 +24,11 @@ static void aesgcm_encrypt_block(const struct crypto_aes_ctx *ctx, void *dst,\n \t * mitigates this risk to some extent by pulling the entire S-box into\n \t * the caches before doing any substitutions, but this strategy is more\n \t * effective when running with interrupts disabled.\n \t */\n \tlocal_irq_save(flags);\n-\taes_encrypt(ctx, dst, src);\n+\taes_encrypt(key, dst, src);\n \tlocal_irq_restore(flags);\n }\n \n /**\n * aesgcm_expandkey - Expands the AES and GHASH keys for the AES-GCM key\n@@ -47,16 +47,16 @@ int aesgcm_expandkey(struct aesgcm_ctx *ctx, const u8 *key,\n {\n \tu8 kin[AES_BLOCK_SIZE] = {};\n \tint ret;\n \n \tret = crypto_gcm_check_authsize(authsize) ?:\n-\t aes_expandkey(&ctx->aes_ctx, key, keysize);\n+\t aes_prepareenckey(&ctx->aes_key, key, keysize);\n \tif (ret)\n \t\treturn ret;\n \n \tctx->authsize = authsize;\n-\taesgcm_encrypt_block(&ctx->aes_ctx, &ctx->ghash_key, kin);\n+\taesgcm_encrypt_block(&ctx->aes_key, &ctx->ghash_key, kin);\n \n \treturn 0;\n }\n EXPORT_SYMBOL(aesgcm_expandkey);\n \n@@ -95,11 +95,11 @@ static void aesgcm_mac(const struct aesgcm_ctx *ctx, const u8 *src, int src_len,\n \taesgcm_ghash(&ghash, &ctx->ghash_key, assoc, assoc_len);\n \taesgcm_ghash(&ghash, &ctx->ghash_key, src, src_len);\n \taesgcm_ghash(&ghash, &ctx->ghash_key, &tail, sizeof(tail));\n \n \tctr[3] = cpu_to_be32(1);\n-\taesgcm_encrypt_block(&ctx->aes_ctx, buf, ctr);\n+\taesgcm_encrypt_block(&ctx->aes_key, buf, ctr);\n \tcrypto_xor_cpy(authtag, buf, (u8 *)&ghash, ctx->authsize);\n \n \tmemzero_explicit(&ghash, sizeof(ghash));\n \tmemzero_explicit(buf, sizeof(buf));\n }\n@@ -117,11 +117,11 @@ static void aesgcm_crypt(const struct aesgcm_ctx *ctx, u8 *dst, const u8 *src,\n \t\t * inadvertent IV reuse, which must be avoided at all cost for\n \t\t * stream ciphers such as AES-CTR. Given the range of 'int\n \t\t * len', this cannot happen, so no explicit test is necessary.\n \t\t */\n \t\tctr[3] = cpu_to_be32(n++);\n-\t\taesgcm_encrypt_block(&ctx->aes_ctx, buf, ctr);\n+\t\taesgcm_encrypt_block(&ctx->aes_key, buf, ctr);\n \t\tcrypto_xor_cpy(dst, src, buf, min(len, AES_BLOCK_SIZE));\n \n \t\tdst += AES_BLOCK_SIZE;\n \t\tsrc += AES_BLOCK_SIZE;\n \t\tlen -= AES_BLOCK_SIZE;\n", "prefixes": [ "v2", "33/35" ] }