From patchwork Tue Feb 14 21:43:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 9572987 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C04C360578 for ; Tue, 14 Feb 2017 21:46:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3224281E1 for ; Tue, 14 Feb 2017 21:46:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7CB3283F6; Tue, 14 Feb 2017 21:46:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 560CB281E1 for ; Tue, 14 Feb 2017 21:46:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753311AbdBNVqH (ORCPT ); Tue, 14 Feb 2017 16:46:07 -0500 Received: from mail-it0-f46.google.com ([209.85.214.46]:33071 "EHLO mail-it0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753175AbdBNVqG (ORCPT ); Tue, 14 Feb 2017 16:46:06 -0500 Received: by mail-it0-f46.google.com with SMTP id d9so21202164itc.0 for ; Tue, 14 Feb 2017 13:46:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=B2LZNTiwVNZqmnC9UIifMMSCXEONMBnepTjy8nqqA5o=; b=s8mAgcRXx+SjrZ5qP0WHHAfKdnr+iq80SlXcSUJYki8x7Yphd4gdcD1dGUNFitU1z9 sdUuGiQOHcFMCwze/WEWnfhRFf0OHoXR6ZZConTfLDF9KTa8sYEUBeRItRUwDZQLF8Hr 9FaYau73qyOM2PldgZDfhS0rvvNIw3Gf4KBxfRtDcG20IWl0XvPFyAPjAlapvsl+w3xF fLhW/CMWCNoIolpiDeFsAmvSVFkw1GygpWHm8KaRWtgLTzcYjNgGbwPodZr+33BigIHH IAmuGo5aUL4EZTG/B7v/BOYbmBIAmOfyF0a9c62H1rdiFSyLTKHls117M74jN/9UktOV Yiog== 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=B2LZNTiwVNZqmnC9UIifMMSCXEONMBnepTjy8nqqA5o=; b=Kn2K8V7RYV71MT42z2UWxOx6h8KwIw7/x4+73Ybb8ovvbWTAFjuMYjrO6MJt0Scwx2 nVXOXklvalqMcmaubLkYPoM8omP9IcsiKex7YIog5CgnbniUej2BxOh8JdjXfCWEH4gx 9vBB+9BRThrEiQGjqEJuLXnd07AwsFzqJyq+euRDd0xQ5+lJ7+q8tTSRZpekSxUw8Y/i XlqLO6kZPoz7mtAply8+8HlyJj3xfQa0rgEZD4edcoYTzleRSCMf51noD6MOhqLkStcF hWmxohdMa3XEqURJBH9s83oKmnJZ981fYgg9P/rsIGMb/0aDSBnPjZM2aPCsZBEgPqkG bBJg== X-Gm-Message-State: AMke39lxJm0oDn1G1Ke16UdHm3KvEXoNcfNuGF9rsHwrQq9GQ/Rk4t96hq3Khakn/p1FbW20 X-Received: by 10.84.136.135 with SMTP id 7mr39297543pll.149.1487108764960; Tue, 14 Feb 2017 13:46:04 -0800 (PST) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.119.30.131]) by smtp.gmail.com with ESMTPSA id a25sm3052751pgd.26.2017.02.14.13.46.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Feb 2017 13:46:04 -0800 (PST) From: Eric Biggers To: linux-crypto@vger.kernel.org Cc: Herbert Xu , "David S . Miller" , Eric Biggers , Alex Cope Subject: [PATCH 4/4] crypto: gf128mul - constify 4k and 64k multiplication tables Date: Tue, 14 Feb 2017 13:43:30 -0800 Message-Id: <20170214214330.99845-5-ebiggers@google.com> X-Mailer: git-send-email 2.11.0.483.g087da7b7c-goog In-Reply-To: <20170214214330.99845-1-ebiggers@google.com> References: <20170214214330.99845-1-ebiggers@google.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Constify the multiplication tables passed to the 4k and 64k multiplication functions, as they are not modified by these functions. Cc: Alex Cope Signed-off-by: Eric Biggers --- crypto/gf128mul.c | 6 +++--- include/crypto/gf128mul.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crypto/gf128mul.c b/crypto/gf128mul.c index 1fde1c79ffa5..04facc0690aa 100644 --- a/crypto/gf128mul.c +++ b/crypto/gf128mul.c @@ -329,7 +329,7 @@ void gf128mul_free_64k(struct gf128mul_64k *t) } EXPORT_SYMBOL(gf128mul_free_64k); -void gf128mul_64k_bbe(be128 *a, struct gf128mul_64k *t) +void gf128mul_64k_bbe(be128 *a, const struct gf128mul_64k *t) { u8 *ap = (u8 *)a; be128 r[1]; @@ -402,7 +402,7 @@ struct gf128mul_4k *gf128mul_init_4k_bbe(const be128 *g) } EXPORT_SYMBOL(gf128mul_init_4k_bbe); -void gf128mul_4k_lle(be128 *a, struct gf128mul_4k *t) +void gf128mul_4k_lle(be128 *a, const struct gf128mul_4k *t) { u8 *ap = (u8 *)a; be128 r[1]; @@ -417,7 +417,7 @@ void gf128mul_4k_lle(be128 *a, struct gf128mul_4k *t) } EXPORT_SYMBOL(gf128mul_4k_lle); -void gf128mul_4k_bbe(be128 *a, struct gf128mul_4k *t) +void gf128mul_4k_bbe(be128 *a, const struct gf128mul_4k *t) { u8 *ap = (u8 *)a; be128 r[1]; diff --git a/include/crypto/gf128mul.h b/include/crypto/gf128mul.h index 9662c4538873..0bc9b5f1c45e 100644 --- a/include/crypto/gf128mul.h +++ b/include/crypto/gf128mul.h @@ -174,8 +174,8 @@ struct gf128mul_4k { struct gf128mul_4k *gf128mul_init_4k_lle(const be128 *g); struct gf128mul_4k *gf128mul_init_4k_bbe(const be128 *g); -void gf128mul_4k_lle(be128 *a, struct gf128mul_4k *t); -void gf128mul_4k_bbe(be128 *a, struct gf128mul_4k *t); +void gf128mul_4k_lle(be128 *a, const struct gf128mul_4k *t); +void gf128mul_4k_bbe(be128 *a, const struct gf128mul_4k *t); static inline void gf128mul_free_4k(struct gf128mul_4k *t) { @@ -196,6 +196,6 @@ struct gf128mul_64k { */ struct gf128mul_64k *gf128mul_init_64k_bbe(const be128 *g); void gf128mul_free_64k(struct gf128mul_64k *t); -void gf128mul_64k_bbe(be128 *a, struct gf128mul_64k *t); +void gf128mul_64k_bbe(be128 *a, const struct gf128mul_64k *t); #endif /* _CRYPTO_GF128MUL_H */