20 #include <linux/kernel.h>
21 #include <linux/module.h>
23 #define GHASH_BLOCK_SIZE 16
24 #define GHASH_DIGEST_SIZE 16
39 memset(dctx, 0,
sizeof(*dctx));
45 const u8 *
key,
unsigned int keylen)
55 gf128mul_free_4k(ctx->
gf128);
63 static int ghash_update(
struct shash_desc *desc,
64 const u8 *
src,
unsigned int srclen)
110 while (dctx->
bytes--)
119 static int ghash_final(
struct shash_desc *desc,
u8 *dst)
128 ghash_flush(ctx, dctx);
134 static void ghash_exit_tfm(
struct crypto_tfm *tfm)
136 struct ghash_ctx *ctx = crypto_tfm_ctx(tfm);
138 gf128mul_free_4k(ctx->
gf128);
144 .update = ghash_update,
145 .final = ghash_final,
146 .setkey = ghash_setkey,
150 .cra_driver_name =
"ghash-generic",
156 .cra_exit = ghash_exit_tfm,
160 static int __init ghash_mod_init(
void)
165 static void __exit ghash_mod_exit(
void)