From nobody Fri Jan 9 11:49:42 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1766732ED55; Mon, 5 Jan 2026 05:15:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767590114; cv=none; b=Yu/hLF74DoOrRc4FugAqZWAunAvbpY8B7Je1xp2sK/K9XM5I8fafpfUCOaDMsAlg2CwAM5gkSs+AaHBExrtgfXJLX5D48W0roglDwZgnmfkPNA4FZD5K+CfjDcNHsPhChkcyEf4CFV2Dq6XMt0bZYQfn6L04eCVCWLFwa7AzDmw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767590114; c=relaxed/simple; bh=GDbwir3woPjBVitmEL25MOIVKvd8ieBzlM6MRGrA/+E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Tb0g67G9BHFlispJOEm108iDcJMRroIhI127I6q5WvGjGIKivp9ds7NwixY2v1jpIQwTWBPEFe9HOLkArmrh6fPv/Oknb8HeC5scZtrp0cPZTJ8FiufvPkxdDMK34ycLhdwZcP/2ofROLlxId9X52loSDh0QLZ6qm/RUMXbOUMo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RVtoy7ZQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RVtoy7ZQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33D10C19425; Mon, 5 Jan 2026 05:15:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1767590113; bh=GDbwir3woPjBVitmEL25MOIVKvd8ieBzlM6MRGrA/+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RVtoy7ZQUFg8Jzw8Ttz0Hu793dlq4dRcJOMCE3DC876cPxOZI0AXwX23B3DFwTRZD pVTOi71t1nzHRgbviXZD0KZKR67qflJNsc02gx2AZdYyQ3VR3EH8H82+8wIcrWYHqb Bhfy+hbGQk9+ONjzliHdvWbpbuXhuOyHqIsfnSElCQCMwy3lEnx895mPsU2WjO1ECa tSVddV27n6EBGuZLwEDkwu8GoUtRbob/QGx2qAiMMSVidlnjhmu29bvOEFCVDU8mB8 nubJvYr+4h9ydqL/ziDDoQ7O9w/hifhTZ5gaUJCKb+PqR5Y8EahbJkEFFoSzYrAkk4 D+csKrzyaZ8hQ== From: Eric Biggers To: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Ard Biesheuvel , "Jason A . Donenfeld" , Herbert Xu , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org, Holger Dengler , Harald Freudenberger , Eric Biggers Subject: [PATCH 35/36] lib/crypto: aes: Drop "_new" suffix from en/decryption functions Date: Sun, 4 Jan 2026 21:13:08 -0800 Message-ID: <20260105051311.1607207-36-ebiggers@kernel.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260105051311.1607207-1-ebiggers@kernel.org> References: <20260105051311.1607207-1-ebiggers@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now that all callers of aes_encrypt() and aes_decrypt() have been updated to use aes_encrypt_new() and aes_decrypt_new() instead, and the original aes_encrypt() and aes_decrypt() have been removed, drop the "_new" suffix. This completes the migration to the revised AES API, which uses a different type for the key argument and is more efficient when the user only requires the encryption direction of the cipher. Signed-off-by: Eric Biggers --- arch/arm/crypto/aes-neonbs-glue.c | 8 ++++---- arch/arm/crypto/ghash-ce-glue.c | 2 +- arch/arm64/crypto/ghash-ce-glue.c | 2 +- arch/riscv/crypto/aes-riscv64-glue.c | 2 +- arch/x86/crypto/aesni-intel_glue.c | 2 +- crypto/aes.c | 4 ++-- crypto/df_sp80090a.c | 2 +- drivers/crypto/amcc/crypto4xx_alg.c | 2 +- drivers/crypto/ccp/ccp-crypto-aes-cmac.c | 2 +- drivers/crypto/chelsio/chcr_algo.c | 6 +++--- drivers/crypto/inside-secure/safexcel_cipher.c | 2 +- drivers/crypto/inside-secure/safexcel_hash.c | 16 ++++++++-------- drivers/crypto/omap-aes-gcm.c | 2 +- .../chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c | 2 +- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 2 +- .../chelsio/inline_crypto/chtls/chtls_hw.c | 2 +- drivers/net/phy/mscc/mscc_macsec.c | 2 +- drivers/staging/rtl8723bs/core/rtw_security.c | 8 ++++---- include/crypto/aes.h | 12 ++++++------ lib/crypto/aes.c | 12 ++++++------ lib/crypto/aescfb.c | 2 +- lib/crypto/aesgcm.c | 2 +- net/bluetooth/smp.c | 2 +- 23 files changed, 49 insertions(+), 49 deletions(-) diff --git a/arch/arm/crypto/aes-neonbs-glue.c b/arch/arm/crypto/aes-neonbs= -glue.c index f892f281b441..c49ddafc54f3 100644 --- a/arch/arm/crypto/aes-neonbs-glue.c +++ b/arch/arm/crypto/aes-neonbs-glue.c @@ -154,11 +154,11 @@ static int cbc_encrypt(struct skcipher_request *req) u8 *dst =3D walk.dst.virt.addr; u8 *prev =3D walk.iv; =20 do { crypto_xor_cpy(dst, src, prev, AES_BLOCK_SIZE); - aes_encrypt_new(&ctx->fallback, dst, dst); + aes_encrypt(&ctx->fallback, dst, dst); prev =3D dst; src +=3D AES_BLOCK_SIZE; dst +=3D AES_BLOCK_SIZE; nbytes -=3D AES_BLOCK_SIZE; } while (nbytes >=3D AES_BLOCK_SIZE); @@ -280,11 +280,11 @@ static int __xts_crypt(struct skcipher_request *req, = bool encrypt, =20 err =3D skcipher_walk_virt(&walk, req, true); if (err) return err; =20 - aes_encrypt_new(&ctx->tweak_key, walk.iv, walk.iv); + aes_encrypt(&ctx->tweak_key, walk.iv, walk.iv); =20 while (walk.nbytes >=3D AES_BLOCK_SIZE) { unsigned int blocks =3D walk.nbytes / AES_BLOCK_SIZE; int reorder_last_tweak =3D !encrypt && tail > 0; =20 @@ -312,13 +312,13 @@ static int __xts_crypt(struct skcipher_request *req, = bool encrypt, scatterwalk_map_and_copy(buf, req->src, req->cryptlen, tail, 0); =20 crypto_xor(buf, req->iv, AES_BLOCK_SIZE); =20 if (encrypt) - aes_encrypt_new(&ctx->fallback, buf, buf); + aes_encrypt(&ctx->fallback, buf, buf); else - aes_decrypt_new(&ctx->fallback, buf, buf); + aes_decrypt(&ctx->fallback, buf, buf); =20 crypto_xor(buf, req->iv, AES_BLOCK_SIZE); =20 scatterwalk_map_and_copy(buf, req->dst, req->cryptlen - AES_BLOCK_SIZE, AES_BLOCK_SIZE + tail, 1); diff --git a/arch/arm/crypto/ghash-ce-glue.c b/arch/arm/crypto/ghash-ce-glu= e.c index 9ab03bce352d..454adcc62cc6 100644 --- a/arch/arm/crypto/ghash-ce-glue.c +++ b/arch/arm/crypto/ghash-ce-glue.c @@ -210,11 +210,11 @@ static int gcm_aes_setkey(struct crypto_aead *tfm, co= nst u8 *inkey, =20 ret =3D aes_prepareenckey(&aes_key, inkey, keylen); if (ret) return -EINVAL; =20 - aes_encrypt_new(&aes_key, (u8 *)&k, (u8[AES_BLOCK_SIZE]){}); + aes_encrypt(&aes_key, (u8 *)&k, (u8[AES_BLOCK_SIZE]){}); =20 /* * Note: this assumes that the arm implementation of the AES library * stores the standard round keys in k.rndkeys. */ diff --git a/arch/arm64/crypto/ghash-ce-glue.c b/arch/arm64/crypto/ghash-ce= -glue.c index bfd38e485e77..63bb9e062251 100644 --- a/arch/arm64/crypto/ghash-ce-glue.c +++ b/arch/arm64/crypto/ghash-ce-glue.c @@ -196,11 +196,11 @@ static int gcm_aes_setkey(struct crypto_aead *tfm, co= nst u8 *inkey, =20 ret =3D aes_prepareenckey(&ctx->aes_key, inkey, keylen); if (ret) return -EINVAL; =20 - aes_encrypt_new(&ctx->aes_key, key, (u8[AES_BLOCK_SIZE]){}); + aes_encrypt(&ctx->aes_key, key, (u8[AES_BLOCK_SIZE]){}); =20 /* needed for the fallback */ memcpy(&ctx->ghash_key.k, key, GHASH_BLOCK_SIZE); =20 ghash_reflect(ctx->ghash_key.h[0], &ctx->ghash_key.k); diff --git a/arch/riscv/crypto/aes-riscv64-glue.c b/arch/riscv/crypto/aes-r= iscv64-glue.c index e1b8b0d70666..8d6d4338b90b 100644 --- a/arch/riscv/crypto/aes-riscv64-glue.c +++ b/arch/riscv/crypto/aes-riscv64-glue.c @@ -320,11 +320,11 @@ static int riscv64_aes_xts_crypt(struct skcipher_requ= est *req, bool enc) =20 if (req->cryptlen < AES_BLOCK_SIZE) return -EINVAL; =20 /* Encrypt the IV with the tweak key to get the first tweak. */ - aes_encrypt_new(&ctx->tweak_key, req->iv, req->iv); + aes_encrypt(&ctx->tweak_key, req->iv, req->iv); =20 err =3D skcipher_walk_virt(&walk, req, false); =20 /* * If the message length isn't divisible by the AES block size and the diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-int= el_glue.c index 5633e50e46a0..e6c38d1d8a92 100644 --- a/arch/x86/crypto/aesni-intel_glue.c +++ b/arch/x86/crypto/aesni-intel_glue.c @@ -1211,11 +1211,11 @@ static int gcm_setkey(struct crypto_aead *tfm, cons= t u8 *raw_key, be128 h1 =3D {}; be128 h; int i; =20 /* Encrypt the all-zeroes block to get the hash key H^1 */ - aes_encrypt_new(&key->aes_key, (u8 *)&h1, (u8 *)&h1); + aes_encrypt(&key->aes_key, (u8 *)&h1, (u8 *)&h1); =20 /* Compute H^1 * x^-1 */ h =3D h1; gf128mul_lle(&h, (const be128 *)x_to_the_minus1); =20 diff --git a/crypto/aes.c b/crypto/aes.c index 5c3a0b24dbc0..ae8385df0ce5 100644 --- a/crypto/aes.c +++ b/crypto/aes.c @@ -21,18 +21,18 @@ static int crypto_aes_setkey(struct crypto_tfm *tfm, co= nst u8 *in_key, =20 static void crypto_aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *= in) { const struct aes_key *key =3D crypto_tfm_ctx(tfm); =20 - aes_encrypt_new(key, out, in); + aes_encrypt(key, out, in); } =20 static void crypto_aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *= in) { const struct aes_key *key =3D crypto_tfm_ctx(tfm); =20 - aes_decrypt_new(key, out, in); + aes_decrypt(key, out, in); } =20 static struct crypto_alg alg =3D { .cra_name =3D "aes", .cra_driver_name =3D "aes-lib", diff --git a/crypto/df_sp80090a.c b/crypto/df_sp80090a.c index 5686d37ebba2..b8134be6f7ad 100644 --- a/crypto/df_sp80090a.c +++ b/crypto/df_sp80090a.c @@ -17,11 +17,11 @@ static void drbg_kcapi_sym(struct aes_enckey *aeskey, unsigned char *outva= l, const struct drbg_string *in, u8 blocklen_bytes) { /* there is only component in *in */ BUG_ON(in->len < blocklen_bytes); - aes_encrypt_new(aeskey, outval, in->buf); + aes_encrypt(aeskey, outval, in->buf); } =20 /* BCC function for CTR DRBG as defined in 10.4.3 */ =20 static void drbg_ctr_bcc(struct aes_enckey *aeskey, diff --git a/drivers/crypto/amcc/crypto4xx_alg.c b/drivers/crypto/amcc/cryp= to4xx_alg.c index 1947708334ef..3177dc4f5f7b 100644 --- a/drivers/crypto/amcc/crypto4xx_alg.c +++ b/drivers/crypto/amcc/crypto4xx_alg.c @@ -499,11 +499,11 @@ static int crypto4xx_compute_gcm_hash_key_sw(__le32 *= hash_start, const u8 *key, if (rc) { pr_err("aes_prepareenckey() failed: %d\n", rc); return rc; } =20 - aes_encrypt_new(&aes, src, src); + aes_encrypt(&aes, src, src); crypto4xx_memcpy_to_le32(hash_start, src, 16); memzero_explicit(&aes, sizeof(aes)); return 0; } =20 diff --git a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c b/drivers/crypto/ccp/= ccp-crypto-aes-cmac.c index ed5b0f8609f1..71480f7e6f6b 100644 --- a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c +++ b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c @@ -288,11 +288,11 @@ static int ccp_aes_cmac_setkey(struct crypto_ahash *t= fm, const u8 *key, if (ret) return ret; =20 /* Encrypt a block of zeroes - use key area in context */ memset(ctx->u.aes.key, 0, sizeof(ctx->u.aes.key)); - aes_encrypt_new(&aes, ctx->u.aes.key, ctx->u.aes.key); + aes_encrypt(&aes, ctx->u.aes.key, ctx->u.aes.key); memzero_explicit(&aes, sizeof(aes)); =20 /* Generate K1 and K2 */ k0_hi =3D be64_to_cpu(*((__be64 *)ctx->u.aes.key)); k0_lo =3D be64_to_cpu(*((__be64 *)ctx->u.aes.key + 1)); diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/ch= cr_algo.c index b6b97088dfc5..6dec42282768 100644 --- a/drivers/crypto/chelsio/chcr_algo.c +++ b/drivers/crypto/chelsio/chcr_algo.c @@ -1047,19 +1047,19 @@ static int chcr_update_tweak(struct skcipher_reques= t *req, u8 *iv, ret =3D aes_preparekey(&aes, key, keylen - 8); else ret =3D aes_preparekey(&aes, key, keylen); if (ret) return ret; - aes_encrypt_new(&aes, iv, iv); + aes_encrypt(&aes, iv, iv); for (i =3D 0; i < round8; i++) gf128mul_x8_ble((le128 *)iv, (le128 *)iv); =20 for (i =3D 0; i < (round % 8); i++) gf128mul_x_ble((le128 *)iv, (le128 *)iv); =20 if (!isfinal) - aes_decrypt_new(&aes, iv, iv); + aes_decrypt(&aes, iv, iv); =20 memzero_explicit(&aes, sizeof(aes)); return 0; } =20 @@ -3448,11 +3448,11 @@ static int chcr_gcm_setkey(struct crypto_aead *aead= , const u8 *key, if (ret) { aeadctx->enckey_len =3D 0; goto out; } memset(gctx->ghash_h, 0, AEAD_H_SIZE); - aes_encrypt_new(&aes, gctx->ghash_h, gctx->ghash_h); + aes_encrypt(&aes, gctx->ghash_h, gctx->ghash_h); memzero_explicit(&aes, sizeof(aes)); =20 out: return ret; } diff --git a/drivers/crypto/inside-secure/safexcel_cipher.c b/drivers/crypt= o/inside-secure/safexcel_cipher.c index eb4e0dc38b7f..27b180057417 100644 --- a/drivers/crypto/inside-secure/safexcel_cipher.c +++ b/drivers/crypto/inside-secure/safexcel_cipher.c @@ -2529,11 +2529,11 @@ static int safexcel_aead_gcm_setkey(struct crypto_a= ead *ctfm, const u8 *key, =20 ctx->key_len =3D len; =20 /* Compute hash key by encrypting zeroes with cipher key */ memset(hashkey, 0, AES_BLOCK_SIZE); - aes_encrypt_new(&aes, (u8 *)hashkey, (u8 *)hashkey); + aes_encrypt(&aes, (u8 *)hashkey, (u8 *)hashkey); =20 if (priv->flags & EIP197_TRC_CACHE && ctx->base.ctxr_dma) { for (i =3D 0; i < AES_BLOCK_SIZE / sizeof(u32); i++) { if (be32_to_cpu(ctx->base.ipad.be[i]) !=3D hashkey[i]) { ctx->base.needs_inv =3D true; diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/= inside-secure/safexcel_hash.c index dae10d0066d7..e534b7a200cf 100644 --- a/drivers/crypto/inside-secure/safexcel_hash.c +++ b/drivers/crypto/inside-secure/safexcel_hash.c @@ -820,11 +820,11 @@ static int safexcel_ahash_final(struct ahash_request = *areq) =20 /* K3 */ result[i] =3D swab32(ctx->base.ipad.word[i + 4]); } areq->result[0] ^=3D 0x80; // 10- padding - aes_encrypt_new(ctx->aes, areq->result, areq->result); + aes_encrypt(ctx->aes, areq->result, areq->result); return 0; } else if (unlikely(req->hmac && (req->len =3D=3D req->block_sz) && !areq->nbytes)) { /* @@ -1979,16 +1979,16 @@ static int safexcel_xcbcmac_setkey(struct crypto_ah= ash *tfm, const u8 *key, ret =3D aes_prepareenckey(ctx->aes, key, len); if (ret) return ret; =20 /* precompute the XCBC key material */ - aes_encrypt_new(ctx->aes, (u8 *)key_tmp + 2 * AES_BLOCK_SIZE, - "\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1"); - aes_encrypt_new(ctx->aes, (u8 *)key_tmp, - "\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2"); - aes_encrypt_new(ctx->aes, (u8 *)key_tmp + AES_BLOCK_SIZE, - "\x3\x3\x3\x3\x3\x3\x3\x3\x3\x3\x3\x3\x3\x3\x3\x3"); + aes_encrypt(ctx->aes, (u8 *)key_tmp + 2 * AES_BLOCK_SIZE, + "\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1"); + aes_encrypt(ctx->aes, (u8 *)key_tmp, + "\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2"); + aes_encrypt(ctx->aes, (u8 *)key_tmp + AES_BLOCK_SIZE, + "\x3\x3\x3\x3\x3\x3\x3\x3\x3\x3\x3\x3\x3\x3\x3\x3"); for (i =3D 0; i < 3 * AES_BLOCK_SIZE / sizeof(u32); i++) ctx->base.ipad.word[i] =3D swab32(key_tmp[i]); =20 ret =3D aes_prepareenckey(ctx->aes, (u8 *)key_tmp + 2 * AES_BLOCK_SIZE, @@ -2070,11 +2070,11 @@ static int safexcel_cmac_setkey(struct crypto_ahash= *tfm, const u8 *key, ctx->base.ipad.word[i + 8] =3D get_unaligned_be32(&key[4 * i]); =20 /* code below borrowed from crypto/cmac.c */ /* encrypt the zero block */ memset(consts, 0, AES_BLOCK_SIZE); - aes_encrypt_new(ctx->aes, (u8 *)consts, (u8 *)consts); + aes_encrypt(ctx->aes, (u8 *)consts, (u8 *)consts); =20 gfmask =3D 0x87; _const[0] =3D be64_to_cpu(consts[1]); _const[1] =3D be64_to_cpu(consts[0]); =20 diff --git a/drivers/crypto/omap-aes-gcm.c b/drivers/crypto/omap-aes-gcm.c index efe94a983589..c652f9d0062f 100644 --- a/drivers/crypto/omap-aes-gcm.c +++ b/drivers/crypto/omap-aes-gcm.c @@ -175,11 +175,11 @@ static int omap_aes_gcm_copy_buffers(struct omap_aes_= dev *dd, =20 static int do_encrypt_iv(struct aead_request *req, u32 *tag, u32 *iv) { struct omap_aes_gcm_ctx *ctx =3D crypto_aead_ctx(crypto_aead_reqtfm(req)); =20 - aes_encrypt_new(&ctx->akey, (u8 *)tag, (const u8 *)iv); + aes_encrypt(&ctx->akey, (u8 *)tag, (const u8 *)iv); return 0; } =20 void omap_aes_gcm_dma_out_callback(void *data) { 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 index 882d09b2b1a8..074717d4bb16 100644 --- a/drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c +++ b/drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c @@ -208,11 +208,11 @@ static int ch_ipsec_setkey(struct xfrm_state *x, if (ret) { sa_entry->enckey_len =3D 0; goto out; } memset(ghash_h, 0, AEAD_H_SIZE); - aes_encrypt_new(&aes, ghash_h, ghash_h); + aes_encrypt(&aes, ghash_h, ghash_h); memzero_explicit(&aes, sizeof(aes)); =20 memcpy(sa_entry->key + (DIV_ROUND_UP(sa_entry->enckey_len, 16) * 16), ghash_h, AEAD_H_SIZE); sa_entry->kctx_len =3D ((DIV_ROUND_UP(sa_entry->enckey_len, 16)) << 4) + diff --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 index 09c0687f911f..b8ebb56de65e 100644 --- a/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c +++ b/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c @@ -141,11 +141,11 @@ static int chcr_ktls_save_keys(struct chcr_ktls_info = *tx_info, ret =3D aes_prepareenckey(&aes, key, keylen); if (ret) goto out; =20 memset(ghash_h, 0, ghash_size); - aes_encrypt_new(&aes, ghash_h, ghash_h); + aes_encrypt(&aes, ghash_h, ghash_h); memzero_explicit(&aes, sizeof(aes)); =20 /* fill the Key context */ if (direction =3D=3D TLS_OFFLOAD_CTX_DIR_TX) { kctx->ctx_hdr =3D FILL_KEY_CTX_HDR(ck_size, diff --git a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_hw.c b/= drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_hw.c index be2b623957c0..d84473ca844d 100644 --- a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_hw.c +++ b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_hw.c @@ -294,11 +294,11 @@ static int chtls_key_info(struct chtls_sock *csk, ret =3D aes_prepareenckey(&aes, key, keylen); if (ret) return ret; =20 memset(ghash_h, 0, AEAD_H_SIZE); - aes_encrypt_new(&aes, ghash_h, ghash_h); + aes_encrypt(&aes, ghash_h, ghash_h); memzero_explicit(&aes, sizeof(aes)); csk->tlshws.keylen =3D key_ctx_size; =20 /* Copy the Key context */ if (optname =3D=3D TLS_RX) { diff --git a/drivers/net/phy/mscc/mscc_macsec.c b/drivers/net/phy/mscc/mscc= _macsec.c index bcb7f5a4a8fd..9a38a29cf397 100644 --- a/drivers/net/phy/mscc/mscc_macsec.c +++ b/drivers/net/phy/mscc/mscc_macsec.c @@ -509,11 +509,11 @@ static int vsc8584_macsec_derive_key(const u8 *key, u= 16 key_len, u8 hkey[16]) =20 ret =3D aes_prepareenckey(&aes, key, key_len); if (ret) return ret; =20 - aes_encrypt_new(&aes, hkey, input); + aes_encrypt(&aes, hkey, input); memzero_explicit(&aes, sizeof(aes)); return 0; } =20 static int vsc8584_macsec_transformation(struct phy_device *phydev, diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/stagin= g/rtl8723bs/core/rtw_security.c index 79825324e70f..8ee5bed252bf 100644 --- a/drivers/staging/rtl8723bs/core/rtw_security.c +++ b/drivers/staging/rtl8723bs/core/rtw_security.c @@ -638,11 +638,11 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *pr= ecvframe) static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext) { struct aes_enckey aes; =20 aes_prepareenckey(&aes, key, 16); - aes_encrypt_new(&aes, ciphertext, data); + aes_encrypt(&aes, ciphertext, data); memzero_explicit(&aes, sizeof(aes)); } =20 /************************************************/ /* construct_mic_iv() */ @@ -1434,16 +1434,16 @@ static int omac1_aes_128_vector(u8 *key, size_t num= _elem, pos =3D addr[e]; end =3D pos + len[e]; } } if (left > AES_BLOCK_SIZE) - aes_encrypt_new(&aes, cbc, cbc); + aes_encrypt(&aes, cbc, cbc); left -=3D AES_BLOCK_SIZE; } =20 memset(pad, 0, AES_BLOCK_SIZE); - aes_encrypt_new(&aes, pad, pad); + aes_encrypt(&aes, pad, pad); gf_mulx(pad); =20 if (left || total_len =3D=3D 0) { for (i =3D 0; i < left; i++) { cbc[i] ^=3D *pos++; @@ -1457,11 +1457,11 @@ static int omac1_aes_128_vector(u8 *key, size_t num= _elem, gf_mulx(pad); } =20 for (i =3D 0; i < AES_BLOCK_SIZE; i++) pad[i] ^=3D cbc[i]; - aes_encrypt_new(&aes, pad, mac); + aes_encrypt(&aes, pad, mac); memzero_explicit(&aes, sizeof(aes)); return 0; } =20 /** diff --git a/include/crypto/aes.h b/include/crypto/aes.h index 4ce710209da8..30522cc0604c 100644 --- a/include/crypto/aes.h +++ b/include/crypto/aes.h @@ -299,31 +299,31 @@ typedef union { const struct aes_enckey *enc_key; const struct aes_key *full_key; } aes_encrypt_arg __attribute__ ((__transparent_union__)); =20 /** - * aes_encrypt_new() - Encrypt a single AES block + * aes_encrypt() - Encrypt a single AES block * @key: The AES key, as a pointer to either an encryption-only key * (struct aes_enckey) or a full, bidirectional key (struct aes_key). * @out: Buffer to store the ciphertext block * @in: Buffer containing the plaintext block * * Context: Any context. */ -void aes_encrypt_new(aes_encrypt_arg key, u8 out[at_least AES_BLOCK_SIZE], - const u8 in[at_least AES_BLOCK_SIZE]); +void aes_encrypt(aes_encrypt_arg key, u8 out[at_least AES_BLOCK_SIZE], + const u8 in[at_least AES_BLOCK_SIZE]); =20 /** - * aes_decrypt_new() - Decrypt a single AES block + * aes_decrypt() - Decrypt a single AES block * @key: The AES key, previously initialized by aes_preparekey() * @out: Buffer to store the plaintext block * @in: Buffer containing the ciphertext block * * Context: Any context. */ -void aes_decrypt_new(const struct aes_key *key, u8 out[at_least AES_BLOCK_= SIZE], - const u8 in[at_least AES_BLOCK_SIZE]); +void aes_decrypt(const struct aes_key *key, u8 out[at_least AES_BLOCK_SIZE= ], + const u8 in[at_least AES_BLOCK_SIZE]); =20 extern const u8 crypto_aes_sbox[]; extern const u8 crypto_aes_inv_sbox[]; extern const u32 __cacheline_aligned aes_enc_tab[256]; extern const u32 __cacheline_aligned aes_dec_tab[256]; diff --git a/lib/crypto/aes.c b/lib/crypto/aes.c index f8c67206b850..98ade1758735 100644 --- a/lib/crypto/aes.c +++ b/lib/crypto/aes.c @@ -500,23 +500,23 @@ int aes_prepareenckey(struct aes_enckey *key, const u= 8 *in_key, size_t key_len) { return __aes_preparekey(key, NULL, in_key, key_len); } EXPORT_SYMBOL(aes_prepareenckey); =20 -void aes_encrypt_new(aes_encrypt_arg key, u8 out[AES_BLOCK_SIZE], - const u8 in[AES_BLOCK_SIZE]) +void aes_encrypt(aes_encrypt_arg key, u8 out[AES_BLOCK_SIZE], + const u8 in[AES_BLOCK_SIZE]) { aes_encrypt_arch(key.enc_key, out, in); } -EXPORT_SYMBOL(aes_encrypt_new); +EXPORT_SYMBOL(aes_encrypt); =20 -void aes_decrypt_new(const struct aes_key *key, u8 out[AES_BLOCK_SIZE], - const u8 in[AES_BLOCK_SIZE]) +void aes_decrypt(const struct aes_key *key, u8 out[AES_BLOCK_SIZE], + const u8 in[AES_BLOCK_SIZE]) { aes_decrypt_arch(key, out, in); } -EXPORT_SYMBOL(aes_decrypt_new); +EXPORT_SYMBOL(aes_decrypt); =20 #ifdef aes_mod_init_arch static int __init aes_mod_init(void) { aes_mod_init_arch(); diff --git a/lib/crypto/aescfb.c b/lib/crypto/aescfb.c index 3149d688c4e0..147e5211728f 100644 --- a/lib/crypto/aescfb.c +++ b/lib/crypto/aescfb.c @@ -23,11 +23,11 @@ static void aescfb_encrypt_block(const struct aes_encke= y *key, void *dst, * extent by pulling the entire S-box into the caches before doing any * substitutions, but this strategy is more effective when running with * interrupts disabled. */ local_irq_save(flags); - aes_encrypt_new(key, dst, src); + aes_encrypt(key, dst, src); local_irq_restore(flags); } =20 /** * aescfb_encrypt - Perform AES-CFB encryption on a block of data diff --git a/lib/crypto/aesgcm.c b/lib/crypto/aesgcm.c index 19106fe008fd..02f5b5f32c76 100644 --- a/lib/crypto/aesgcm.c +++ b/lib/crypto/aesgcm.c @@ -24,11 +24,11 @@ static void aesgcm_encrypt_block(const struct aes_encke= y *key, void *dst, * mitigates this risk to some extent by pulling the entire S-box into * the caches before doing any substitutions, but this strategy is more * effective when running with interrupts disabled. */ local_irq_save(flags); - aes_encrypt_new(key, dst, src); + aes_encrypt(key, dst, src); local_irq_restore(flags); } =20 /** * aesgcm_expandkey - Expands the AES and GHASH keys for the AES-GCM key diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 69007e510177..bf61e8841535 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -390,11 +390,11 @@ static int smp_e(const u8 *k, u8 *r) } =20 /* Most significant octet of plaintextData corresponds to data[0] */ swap_buf(r, data, 16); =20 - aes_encrypt_new(&aes, data, data); + aes_encrypt(&aes, data, data); =20 /* Most significant octet of encryptedData corresponds to data[0] */ swap_buf(data, r, 16); =20 SMP_DBG("r %16phN", r); --=20 2.52.0