Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2183195/?format=api
{ "id": 2183195, "url": "http://patchwork.ozlabs.org/api/patches/2183195/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260112192035.10427-21-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-21-ebiggers@kernel.org>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20260112192035.10427-21-ebiggers@kernel.org/", "date": "2026-01-12T19:20:18", "name": "[v2,20/35] chelsio: Use new AES library API", "commit_ref": null, "pull_url": null, "state": "handled-elsewhere", "archived": false, "hash": "32c27a1a87b8bd71624342e9c98b561017c543b7", "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-21-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/2183195/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2183195/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linuxppc-dev+bounces-15563-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=Ztmz/OJn;\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-15563-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)", "lists.ozlabs.org;\n arc=none smtp.remote-ip=172.105.4.254", "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=Ztmz/OJn;\n\tdkim-atps=neutral", "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org\n (client-ip=172.105.4.254; helo=tor.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 4dqj4S0KCVz1xpk\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 13 Jan 2026 06:24:40 +1100 (AEDT)", "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4dqj380Mc8z2yvH;\n\tTue, 13 Jan 2026 06:23:32 +1100 (AEDT)", "from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254])\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 4dqj371fyWz2ytT\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 13 Jan 2026 06:23:31 +1100 (AEDT)", "from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby tor.source.kernel.org (Postfix) with ESMTP id 3AEA960097;\n\tMon, 12 Jan 2026 19:23:29 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id 85F11C16AAE;\n\tMon, 12 Jan 2026 19:23:28 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1768245811;\n\tcv=none;\n b=eRt2XkwfWcC3h7wRw5NJW9QAn3RXNtjMKNYUBuUJCO+0+BnA39i4g74Upy0aVQNAge1Pqbk3rWUW17rTgeLmhHpuup15Kjl9N1ByzJHtrLfrI57a2WfFpLK7j6h1fzMXNYJR01dkv9n8/mg1dW5BJ77ZufynKNt1KtPilPQ6egQNKh8IJNjv59Yn7I9RIE3EIx8SJ1aKaq2zK3QHOBeuTtutm1/i0Qr4H1gRuUOcVZsQ5t3Bo5Sd6B2bA4lxXanvbev7u3lZQFcCRKvwsJvIucAmJqCugj70rv4gD6BR+8/ny5QrYzag7jusPmKbPGB6N3ukKGc6zzMnN3VF5ZkREA==", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1768245811; c=relaxed/relaxed;\n\tbh=DQ7M/QwofijnhNwqbcHQFefUTFJMWmyUFt4ledmWH3g=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=eeAz/vpVdLBb2+iZnVTmqnI28VZ+yYmdq1nXZ7EkG2v6Zyc00p9yjPKrsjXyPxJoL1i33NJlaFiY8HkjMrilMRsDhct+GQrujrEEM/PLA1K0B5z1i6M6XftbZTg2kYAp+35kGKvSn8jgnYfWAqcnm/vrNh93ZpTf+ixF0VH9N72TsFpfRqUqMVU8NU0wtLtWFrhe7aUdPqkRcs2EOPPwztkMijmSv6MJDg3j3Pofg2YAOa9Hqa9Ay9mcLu9lg1aqshfY/HFpBWDrSk2rbmf51YvWFp9du0+LFTsk2M7d//x/laVUsyPMeDrEJ5TfrjTwNkH7o/+oXaulTcnxjSBEKA==", "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=Ztmz/OJn; dkim-atps=neutral;\n spf=pass (client-ip=172.105.4.254; helo=tor.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=1768245808;\n\tbh=xvx6Irt7McLpPRJvPxDb3Q6MTwdCsiaMbdNL/psBoQw=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=Ztmz/OJnF9izXz1+11a8n8ue1FadL6xEIAIHmPJpOtWbTN9uLhp38Q5NZMtTNf8aL\n\t u+iSqUH9pU6VIiYWo3gzNM1xlS7YKdPMY9mbRVfzMqa37dHo65ZjmMu6p85wAVEdAY\n\t bQMwsA23bhIBlPgkuOxsETreww86x/B0/6WYH68Jh94Fyw9pYwW3UUwNKqizt117J0\n\t rxn9PbiGHKUJG859mT4+TqPx0KqNAsb4uGSAm+xwEXDfk1F4iQHO7xwvILfXd2sTKF\n\t 8or8T+eKsv4Mt8hE/RXUc9xdpUYb3qL0VJQMVSdcMV8FUB8VLen/q5RT2A26UjvjRw\n\t rPnOlNCQe1Y7w==", "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 20/35] chelsio: Use new AES library API", "Date": "Mon, 12 Jan 2026 11:20:18 -0800", "Message-ID": "<20260112192035.10427-21-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 .../ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c | 4 ++--\n .../ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 8 ++++----\n .../net/ethernet/chelsio/inline_crypto/chtls/chtls_hw.c | 4 ++--\n 3 files changed, 8 insertions(+), 8 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c b/drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c\nindex 49b57bb5fac1..074717d4bb16 100644\n--- a/drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c\n+++ b/drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c\n@@ -168,11 +168,11 @@ static int ch_ipsec_setkey(struct xfrm_state *x,\n {\n \tint keylen = (x->aead->alg_key_len + 7) / 8;\n \tunsigned char *key = x->aead->alg_key;\n \tint ck_size, key_ctx_size = 0;\n \tunsigned char ghash_h[AEAD_H_SIZE];\n-\tstruct crypto_aes_ctx aes;\n+\tstruct aes_enckey aes;\n \tint ret = 0;\n \n \tif (keylen > 3) {\n \t\tkeylen -= 4; /* nonce/salt is present in the last 4 bytes */\n \t\tmemcpy(sa_entry->salt, key + keylen, 4);\n@@ -202,11 +202,11 @@ static int ch_ipsec_setkey(struct xfrm_state *x,\n \t\t\t\t\t\t key_ctx_size >> 4);\n \n \t/* Calculate the H = CIPH(K, 0 repeated 16 times).\n \t * It will go in key context\n \t */\n-\tret = aes_expandkey(&aes, key, keylen);\n+\tret = aes_prepareenckey(&aes, key, keylen);\n \tif (ret) {\n \t\tsa_entry->enckey_len = 0;\n \t\tgoto out;\n \t}\n \tmemset(ghash_h, 0, AEAD_H_SIZE);\ndiff --git a/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c b/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c\nindex 4e2096e49684..b8ebb56de65e 100644\n--- a/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c\n+++ b/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c\n@@ -74,11 +74,11 @@ static int chcr_ktls_save_keys(struct chcr_ktls_info *tx_info,\n {\n \tint ck_size, key_ctx_size, mac_key_size, keylen, ghash_size, ret;\n \tunsigned char ghash_h[TLS_CIPHER_AES_GCM_256_TAG_SIZE];\n \tstruct tls12_crypto_info_aes_gcm_128 *info_128_gcm;\n \tstruct ktls_key_ctx *kctx = &tx_info->key_ctx;\n-\tstruct crypto_aes_ctx aes_ctx;\n+\tstruct aes_enckey aes;\n \tunsigned char *key, *salt;\n \n \tswitch (crypto_info->cipher_type) {\n \tcase TLS_CIPHER_AES_GCM_128:\n \t\tinfo_128_gcm =\n@@ -136,17 +136,17 @@ static int chcr_ktls_save_keys(struct chcr_ktls_info *tx_info,\n \t\t roundup(keylen, 16) + ghash_size;\n \t/* Calculate the H = CIPH(K, 0 repeated 16 times).\n \t * It will go in key context\n \t */\n \n-\tret = aes_expandkey(&aes_ctx, key, keylen);\n+\tret = aes_prepareenckey(&aes, key, keylen);\n \tif (ret)\n \t\tgoto out;\n \n \tmemset(ghash_h, 0, ghash_size);\n-\taes_encrypt(&aes_ctx, ghash_h, ghash_h);\n-\tmemzero_explicit(&aes_ctx, sizeof(aes_ctx));\n+\taes_encrypt(&aes, ghash_h, ghash_h);\n+\tmemzero_explicit(&aes, sizeof(aes));\n \n \t/* fill the Key context */\n \tif (direction == TLS_OFFLOAD_CTX_DIR_TX) {\n \t\tkctx->ctx_hdr = FILL_KEY_CTX_HDR(ck_size,\n \t\t\t\t\t\t mac_key_size,\ndiff --git a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_hw.c b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_hw.c\nindex fab6df21f01c..d84473ca844d 100644\n--- a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_hw.c\n+++ b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_hw.c\n@@ -245,11 +245,11 @@ static int chtls_key_info(struct chtls_sock *csk,\n {\n \tunsigned char key[AES_MAX_KEY_SIZE];\n \tunsigned char *key_p, *salt;\n \tunsigned char ghash_h[AEAD_H_SIZE];\n \tint ck_size, key_ctx_size, kctx_mackey_size, salt_size;\n-\tstruct crypto_aes_ctx aes;\n+\tstruct aes_enckey aes;\n \tint ret;\n \n \tkey_ctx_size = sizeof(struct _key_ctx) +\n \t\t roundup(keylen, 16) + AEAD_H_SIZE;\n \n@@ -289,11 +289,11 @@ static int chtls_key_info(struct chtls_sock *csk,\n \t}\n \n \t/* Calculate the H = CIPH(K, 0 repeated 16 times).\n \t * It will go in key context\n \t */\n-\tret = aes_expandkey(&aes, key, keylen);\n+\tret = aes_prepareenckey(&aes, key, keylen);\n \tif (ret)\n \t\treturn ret;\n \n \tmemset(ghash_h, 0, AEAD_H_SIZE);\n \taes_encrypt(&aes, ghash_h, ghash_h);\n", "prefixes": [ "v2", "20/35" ] }