Message ID | 20190702194150.10405-29-ard.biesheuvel@linaro.org |
---|---|
State | Accepted |
Commit | 9467a3150cf4afca638673e099af71e8c493a3a0 |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4653800ilk; Tue, 2 Jul 2019 12:42:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqziA4+pg3oKA3hze8ZQO5/FfhVQEwbaKHasF+qFsFcPMpl1e2iddPExc557W7GtHJqreKkj X-Received: by 2002:a17:90a:4803:: with SMTP id a3mr7715027pjh.58.1562096571398; Tue, 02 Jul 2019 12:42:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562096571; cv=none; d=google.com; s=arc-20160816; b=kytcRZo+lPsExWb/qffJSnlhy4I4gx7iesX3sstbl2WleoUr2QG/ak/wmQ8JM18zmS IXWClnQDvEZY9yWP94aPEbxYVfraxGWr/SEU777LYUGxmcuVdMNL3dhaNPzPkE2OIQqw VVwo4zQQAo1MV8oi8DZL+K5loCgXKkRdMahwE6jZn9T1gT1t2fUi5HD/GRd7rAbQj6BM 6Y1epJuy8Dpw29GKULH+j8uYbvPGL3GjfNDwoGOm5zXONir3W4JzUZLnKwP5bJZ3Ghk3 T6czjB0dOkNL07E9syNEPODWqsq9VkJCWrY2VtDD3WL+bcSOph4bK/C2SGrBtDNFAXfH twpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=II4IaI2l8ysBnoBGFcY14xsKlW45HqjpdlGpUkQ7rBQ=; b=ajmZnKa8K984guiXyuBQBzdlhe2PPUs/YIcqQlR60Qz8G6T9z1zuTxcz0vHv37Dwqd frcFdOCRSXSpXu6ZMAb1Zeic8gzyspegjPaaTy0rsCd2xCDwUJg2NYUrrNXvK0mZNyKa mtIdi5A1Ic+0EFMHBuLHSwR1081BNvFTGsMiwTdkEnNC99VlQbGOwkn/A4gBd+Ujz36+ c1387CsQz0RnqKsvqbtw3uPFAjPt7B6jE2BL6qpzcRKzR9V8FKPdJKuj0Qb5PpAad+M1 SOdyDvzcIapaVtTCQSbiSVKI/8XAVooDkvz3baia27GOZIlYBBKMkjU8qxPh0e0WAQ2H Gwsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y4AyQA13; 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: <linux-crypto-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si13733891plf.87.2019.07.02.12.42.51; Tue, 02 Jul 2019 12:42:51 -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=Y4AyQA13; 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 S1727119AbfGBTmu (ORCPT <rfc822;sumit.garg@linaro.org> + 3 others); Tue, 2 Jul 2019 15:42:50 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:37963 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727101AbfGBTmt (ORCPT <rfc822;linux-crypto@vger.kernel.org>); Tue, 2 Jul 2019 15:42:49 -0400 Received: by mail-lj1-f195.google.com with SMTP id r9so18181790ljg.5 for <linux-crypto@vger.kernel.org>; Tue, 02 Jul 2019 12:42:48 -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; bh=II4IaI2l8ysBnoBGFcY14xsKlW45HqjpdlGpUkQ7rBQ=; b=Y4AyQA13rcUlRIXMIl6Mk3NNAkJq4EQnuk82FBjoq/Qv+Zwd6RhPeTxLusCR8WustC r1+2xoT5ECWF5WuYISoiLeM5jQWSXe//Swi827ZKtsu0IFTo4xkstqpFoTQEjgoQB+rS t+pYWKzVpFB3TNV6s6VKBeLJZE9cKibesYLscNDUbJ/dsusDr/ZWmIY7n3cUy47hDSr7 0gHhD3GM6YZqhE7e2G0NkSuENaFunDkqJpWKM2ndKGoyfcEv4deJYy04KjAtp6GACG/U H0/KIEKUScE3ovwYMDBIQme49SbhUYvyMKsC4iDjmujVPtagpRgMFM+lfsDxmNu9aHrk QEyQ== 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; bh=II4IaI2l8ysBnoBGFcY14xsKlW45HqjpdlGpUkQ7rBQ=; b=elXG9DY4wVFFmQZHbepx6/e4fwz5BbtOygLi7EiPBVQVI+raEUr0Zuk4Lv2k0xVRMQ /mJXVRqXKR7J99ffRVz748mgOFnEM/htqi4lroKPn16ah+3b4PJ3MuwaDXk7lwPmNsnz xpzQxGcrkOgtCkYR1TKAX+YMpvadW7sp6c+qzSEsQkKvaBQ4/GZKOXhfA3URjfOTdLe0 68wjXi2h65zLijCm4R1oJJNvy+qn7DwS0t6QYCmT+x8kw1l1XGajiIIQrHBXGVNgcISM oeLblpOL0ppQy2wjAhaQvr+toxSrjvNyLuPYiWYVLP3cMlOgEuM7dhuhu9nF4z6uRIVw Hp6g== X-Gm-Message-State: APjAAAUx5H7AsxLyMrzh0H7b2iJWGl3V2+YwPSsJp9vEQaw4QsOkwVBg YggTCKo0ES3TrJZ7QYiGIQ8fFmRYq6qVU86b X-Received: by 2002:a2e:b1c1:: with SMTP id e1mr18245038lja.228.1562096567433; Tue, 02 Jul 2019 12:42:47 -0700 (PDT) Received: from e111045-lin.arm.com (89-212-78-239.static.t-2.net. [89.212.78.239]) by smtp.gmail.com with ESMTPSA id 24sm4475163ljs.63.2019.07.02.12.42.46 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 12:42:46 -0700 (PDT) From: Ard Biesheuvel <ard.biesheuvel@linaro.org> To: linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, ebiggers@google.com, Ard Biesheuvel <ard.biesheuvel@linaro.org> Subject: [PATCH v4 28/32] crypto: lib/aes - export sbox and inverse sbox Date: Tue, 2 Jul 2019 21:41:46 +0200 Message-Id: <20190702194150.10405-29-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190702194150.10405-1-ard.biesheuvel@linaro.org> References: <20190702194150.10405-1-ard.biesheuvel@linaro.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: <linux-crypto.vger.kernel.org> X-Mailing-List: linux-crypto@vger.kernel.org |
Series |
crypto: AES cleanup
|
expand
|
diff --git a/include/crypto/aes.h b/include/crypto/aes.h index df8426fd8051..8e0f4cf948e5 100644 --- a/include/crypto/aes.h +++ b/include/crypto/aes.h @@ -67,4 +67,7 @@ void aes_encrypt(const struct crypto_aes_ctx *ctx, u8 *out, const u8 *in); */ void aes_decrypt(const struct crypto_aes_ctx *ctx, u8 *out, const u8 *in); +extern const u8 crypto_aes_sbox[]; +extern const u8 crypto_aes_inv_sbox[]; + #endif diff --git a/lib/crypto/aes.c b/lib/crypto/aes.c index 9928b23e0a8a..4e100af38c51 100644 --- a/lib/crypto/aes.c +++ b/lib/crypto/aes.c @@ -82,6 +82,12 @@ static volatile const u8 __cacheline_aligned aes_inv_sbox[] = { 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d, }; +extern const u8 crypto_aes_sbox[256] __alias(aes_sbox); +extern const u8 crypto_aes_inv_sbox[256] __alias(aes_inv_sbox); + +EXPORT_SYMBOL(crypto_aes_sbox); +EXPORT_SYMBOL(crypto_aes_inv_sbox); + static u32 mul_by_x(u32 w) { u32 x = w & 0x7f7f7f7f;
There are a few copies of the AES S-boxes floating around, so export the ones from the AES library so that we can reuse them in other modules. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> --- include/crypto/aes.h | 3 +++ lib/crypto/aes.c | 6 ++++++ 2 files changed, 9 insertions(+) -- 2.17.1