From: Marcelo Cerri <marcelo.cerri@canonical.com>
To: linux-crypto@vger.kernel.org, Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>,
Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>,
"Leonidas S. Barbosa" <leosilva@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
George Wilson <gcwilson@us.ibm.com>,
Marcelo Cerri <marcelo.cerri@canonical.com>
Subject: [PATCH 1/3] crypto: ghash-generic - move common definitions to a new header file
Date: Wed, 28 Sep 2016 13:42:09 -0300 [thread overview]
Message-ID: <1475080931-7926-2-git-send-email-marcelo.cerri@canonical.com> (raw)
In-Reply-To: <1475080931-7926-1-git-send-email-marcelo.cerri@canonical.com>
Move common values and types used by ghash-generic to a new header file
so drivers can directly use ghash-generic as a fallback implementation.
Signed-off-by: Marcelo Cerri <marcelo.cerri@canonical.com>
---
crypto/ghash-generic.c | 13 +------------
include/crypto/ghash.h | 23 +++++++++++++++++++++++
2 files changed, 24 insertions(+), 12 deletions(-)
create mode 100644 include/crypto/ghash.h
diff --git a/crypto/ghash-generic.c b/crypto/ghash-generic.c
index bac7099..12ad3e3 100644
--- a/crypto/ghash-generic.c
+++ b/crypto/ghash-generic.c
@@ -14,24 +14,13 @@
#include <crypto/algapi.h>
#include <crypto/gf128mul.h>
+#include <crypto/ghash.h>
#include <crypto/internal/hash.h>
#include <linux/crypto.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
-#define GHASH_BLOCK_SIZE 16
-#define GHASH_DIGEST_SIZE 16
-
-struct ghash_ctx {
- struct gf128mul_4k *gf128;
-};
-
-struct ghash_desc_ctx {
- u8 buffer[GHASH_BLOCK_SIZE];
- u32 bytes;
-};
-
static int ghash_init(struct shash_desc *desc)
{
struct ghash_desc_ctx *dctx = shash_desc_ctx(desc);
diff --git a/include/crypto/ghash.h b/include/crypto/ghash.h
new file mode 100644
index 0000000..2a61c9b
--- /dev/null
+++ b/include/crypto/ghash.h
@@ -0,0 +1,23 @@
+/*
+ * Common values for GHASH algorithms
+ */
+
+#ifndef __CRYPTO_GHASH_H__
+#define __CRYPTO_GHASH_H__
+
+#include <linux/types.h>
+#include <crypto/gf128mul.h>
+
+#define GHASH_BLOCK_SIZE 16
+#define GHASH_DIGEST_SIZE 16
+
+struct ghash_ctx {
+ struct gf128mul_4k *gf128;
+};
+
+struct ghash_desc_ctx {
+ u8 buffer[GHASH_BLOCK_SIZE];
+ u32 bytes;
+};
+
+#endif
--
2.7.4
next prev parent reply other threads:[~2016-09-28 16:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-28 16:42 [PATCH 0/3] Fix crypto/vmx/p8_ghash memory corruption Marcelo Cerri
2016-09-28 16:42 ` Marcelo Cerri [this message]
2016-09-28 16:42 ` [PATCH 2/3] crypto: vmx - Fix memory corruption caused by p8_ghash Marcelo Cerri
2016-09-28 16:42 ` [PATCH 3/3] crypto: vmx - Ensure ghash-generic is enabled Marcelo Cerri
2016-09-28 20:59 ` [PATCH 0/3] Fix crypto/vmx/p8_ghash memory corruption Anton Blanchard
2016-10-02 14:40 ` Herbert Xu
2016-10-03 12:08 ` Marcelo Cerri
2016-10-02 14:40 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1475080931-7926-2-git-send-email-marcelo.cerri@canonical.com \
--to=marcelo.cerri@canonical.com \
--cc=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=gcwilson@us.ibm.com \
--cc=herbert@gondor.apana.org.au \
--cc=leosilva@linux.vnet.ibm.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=pfsmorigo@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).