From patchwork Wed Jun 12 12:48:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 166549 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp3640604ilk; Wed, 12 Jun 2019 05:48:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqybbwYp+mI1KVBWsTqbWU1DjelqHveOHmYW9AcmsbAMLPPqDj3AiuFGrn6nw8Y4OCjjCdwA X-Received: by 2002:a17:902:21:: with SMTP id 30mr80511778pla.302.1560343732921; Wed, 12 Jun 2019 05:48:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560343732; cv=none; d=google.com; s=arc-20160816; b=nxWPQ/7PZNcX+bAhnUuQsgG/vbV1wb6bVqhlUviqZEYSLO16x8GNkyFoFyWknMCzq2 VkTEhZBL2xZGc2xPhwgX//mZksgW3JpxZVJ6FzThHu8BQOiOnoitMwDVk6MlMmLvrmOK DCJhov23VtBYEtiYwlvJ53WqjSKok+sF1Y6WNi7rrGWYrMxZj6tGcjLUKJGQcK0WgOLc c/V/fCMom+5kpmaYD7OFg49JBpKFO8LTAynj+C9f2u1atDB30lAqrs22cMVFCTld+mLl pHfQ+7EewFnR46cpmPXCDfPfpGJchJn5R+bpanN6TBy+ExGVHo1w0igCtZw7hCTQ3bxJ +gHA== 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=kh+1icf/YKEvTTRJagBGMOB+f2u4C9zDf6SaxozYbCI=; b=KwAR/vEkRX+dn/t3FTCGvUrlCoubP5/uUKQn1U2odrhu6p5wNcoJA6b5lAUu2vhbz9 YEholYgZumDdlWWyOimuCsUL3vbsQAW6x9GpFiEZExGteogGp7yOnFg5nyZxpX76A37Q SV2aI4s6v4IRdiwiFXiBIu+W66ft7/UYWjuWv1nBv8vXUDR9rqBuAwN5RadPDkGmu0xZ tIlWMuOjRGvIrI5oBsCMWi/+PDS5ozCxgneP3hvoiuOF0lYwmGnrJvF2CFXH/C4IbKP2 LEbsRwp4DwTtBAyv8eDt/1nx9O+QP4tC0OqPMi+LzKF4nIf1R1fmLomHJwTRzAZKiEJU 4nNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bm10Ep11; 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 b14si16011497pgk.423.2019.06.12.05.48.52; Wed, 12 Jun 2019 05:48:52 -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=bm10Ep11; 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 S2409156AbfFLMsw (ORCPT + 3 others); Wed, 12 Jun 2019 08:48:52 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:42808 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406812AbfFLMsv (ORCPT ); Wed, 12 Jun 2019 08:48:51 -0400 Received: by mail-wr1-f67.google.com with SMTP id x17so1484707wrl.9 for ; Wed, 12 Jun 2019 05:48:49 -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=kh+1icf/YKEvTTRJagBGMOB+f2u4C9zDf6SaxozYbCI=; b=bm10Ep11t57nCbm56g4vpVdy+Yaj8iHbmgP0FQq92PpqW6tSTKYLwLb9Xfe4PTu7c/ 5WDx8zgtCB2XRC8FbCA+JkKv/3S6EdFvXpC9hRWEwXMrxLmaFh//p5Nicq87n4EsPMNd k95tlbbrkmsBlVWG+v9r/soXrIgwaCjpTDz7066MHcjFV2FGoiAN5FvwSk3S4Q2o3vVD M4D/AYJg36iCrCnxCRYEkv8BB/xsIMEvNaWrWEXbSxT2UQjpBs/YvbzxJoHemS5LTDwL yK4MLTkbFAfzojdtDVwGHH/+LFeLkVbScOB6nefOJ+KMOCQ0yOkkCNoZl88Sy/SO2IvV 8nmQ== 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=kh+1icf/YKEvTTRJagBGMOB+f2u4C9zDf6SaxozYbCI=; b=QnpCEj9Bvm1Lgwaq92ovYpGSu8aQvRqVFzbmxVCVv9IPfXM1S4eD0GPamPM9e6Hg5D hivy/UL/0IMmC/MVE4vpuUHoeDlzlH6bHMlrtWUxYu99u7odkN3zIEIMZYPigbtk5buZ 9SqZeRLI7IAHwCebrtHUlOJtIrbaktJhRKrRpSTC8GYUKV5lClKkAeVVfU4+EIuvtdcU cfKwNQkRixvajNPCarosAng9mXiD1W2Kaj5nVtUxwhEKtPfTiP5ZWBasxXs0jbZvWQsB RIg/NASvgutYKaEJXv0CrA3suY1RIYTY6+ZYByu84f1lvN67gVfHb0P9vFfuSiO6p71K hu8w== X-Gm-Message-State: APjAAAVes539iGHQ1RBma74CwHIP5XGRiF7ol0TryvtKcNAbYgpXjDPc DLR5Vw57oik07NC9ipRsHdAcYIWoxpn0rg== X-Received: by 2002:adf:e6ca:: with SMTP id y10mr40142759wrm.3.1560343729058; Wed, 12 Jun 2019 05:48:49 -0700 (PDT) Received: from sudo.home ([2a01:cb1d:112:6f00:353a:f33a:a393:3ada]) by smtp.gmail.com with ESMTPSA id s8sm28505480wra.55.2019.06.12.05.48.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jun 2019 05:48:48 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, ebiggers@kernel.org, Ard Biesheuvel Subject: [RFC PATCH 02/20] crypto: arm/aes - rename local routines to prevent future clashes Date: Wed, 12 Jun 2019 14:48:20 +0200 Message-Id: <20190612124838.2492-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190612124838.2492-1-ard.biesheuvel@linaro.org> References: <20190612124838.2492-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 Rename some local AES encrypt/decrypt routines so they don't clash with the names we are about to introduce for the routines exposes by the generic AES library. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/aes-cipher-glue.c | 8 ++++---- arch/arm64/crypto/aes-cipher-glue.c | 8 ++++---- crypto/aes_generic.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) -- 2.20.1 diff --git a/arch/arm/crypto/aes-cipher-glue.c b/arch/arm/crypto/aes-cipher-glue.c index c222f6e072ad..f6c07867b8ff 100644 --- a/arch/arm/crypto/aes-cipher-glue.c +++ b/arch/arm/crypto/aes-cipher-glue.c @@ -19,7 +19,7 @@ EXPORT_SYMBOL(__aes_arm_encrypt); asmlinkage void __aes_arm_decrypt(u32 *rk, int rounds, const u8 *in, u8 *out); EXPORT_SYMBOL(__aes_arm_decrypt); -static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) +static void aes_arm_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) { struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); int rounds = 6 + ctx->key_length / 4; @@ -27,7 +27,7 @@ static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) __aes_arm_encrypt(ctx->key_enc, rounds, in, out); } -static void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) +static void aes_arm_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) { struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); int rounds = 6 + ctx->key_length / 4; @@ -47,8 +47,8 @@ static struct crypto_alg aes_alg = { .cra_cipher.cia_min_keysize = AES_MIN_KEY_SIZE, .cra_cipher.cia_max_keysize = AES_MAX_KEY_SIZE, .cra_cipher.cia_setkey = crypto_aes_set_key, - .cra_cipher.cia_encrypt = aes_encrypt, - .cra_cipher.cia_decrypt = aes_decrypt, + .cra_cipher.cia_encrypt = aes_arm_encrypt, + .cra_cipher.cia_decrypt = aes_arm_decrypt, #ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS .cra_alignmask = 3, diff --git a/arch/arm64/crypto/aes-cipher-glue.c b/arch/arm64/crypto/aes-cipher-glue.c index 7288e7cbebff..0e90b06ebcec 100644 --- a/arch/arm64/crypto/aes-cipher-glue.c +++ b/arch/arm64/crypto/aes-cipher-glue.c @@ -18,7 +18,7 @@ EXPORT_SYMBOL(__aes_arm64_encrypt); asmlinkage void __aes_arm64_decrypt(u32 *rk, u8 *out, const u8 *in, int rounds); EXPORT_SYMBOL(__aes_arm64_decrypt); -static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) +static void aes_arm64_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) { struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); int rounds = 6 + ctx->key_length / 4; @@ -26,7 +26,7 @@ static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) __aes_arm64_encrypt(ctx->key_enc, out, in, rounds); } -static void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) +static void aes_arm64_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) { struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); int rounds = 6 + ctx->key_length / 4; @@ -46,8 +46,8 @@ static struct crypto_alg aes_alg = { .cra_cipher.cia_min_keysize = AES_MIN_KEY_SIZE, .cra_cipher.cia_max_keysize = AES_MAX_KEY_SIZE, .cra_cipher.cia_setkey = crypto_aes_set_key, - .cra_cipher.cia_encrypt = aes_encrypt, - .cra_cipher.cia_decrypt = aes_decrypt + .cra_cipher.cia_encrypt = aes_arm64_encrypt, + .cra_cipher.cia_decrypt = aes_arm64_decrypt }; static int __init aes_init(void) diff --git a/crypto/aes_generic.c b/crypto/aes_generic.c index f217568917e4..3aa4a715c216 100644 --- a/crypto/aes_generic.c +++ b/crypto/aes_generic.c @@ -1332,7 +1332,7 @@ EXPORT_SYMBOL_GPL(crypto_aes_set_key); f_rl(bo, bi, 3, k); \ } while (0) -static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) +static void crypto_aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) { const struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); u32 b0[4], b1[4]; @@ -1402,7 +1402,7 @@ static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) i_rl(bo, bi, 3, k); \ } while (0) -static void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) +static void crypto_aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) { const struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); u32 b0[4], b1[4]; @@ -1454,8 +1454,8 @@ static struct crypto_alg aes_alg = { .cia_min_keysize = AES_MIN_KEY_SIZE, .cia_max_keysize = AES_MAX_KEY_SIZE, .cia_setkey = crypto_aes_set_key, - .cia_encrypt = aes_encrypt, - .cia_decrypt = aes_decrypt + .cia_encrypt = crypto_aes_encrypt, + .cia_decrypt = crypto_aes_decrypt } } };