#include <asm/unaligned.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/crypto.h>
#include <linux/module.h>
#include <linux/scatterlist.h>
#include <asm/byteorder.h>
#include <crypto/scatterwalk.h>
#include <crypto/internal/cipher.h>
#include <crypto/internal/hash.h>
#define VMAC_TAG_LEN …
#define VMAC_KEY_SIZE …
#define VMAC_KEY_LEN …
#define VMAC_NHBYTES …
#define VMAC_NONCEBYTES …
struct vmac_tfm_ctx { … };
struct vmac_desc_ctx { … };
#define UINT64_C(x) …
static const u64 p64 = …0xfffffffffffffeff);
static const u64 m62 = …0x3fffffffffffffff);
static const u64 m63 = …0x7fffffffffffffff);
static const u64 m64 = …0xffffffffffffffff);
static const u64 mpoly = …0x1fffffff1fffffff);
#define pe64_to_cpup …
#ifdef __LITTLE_ENDIAN
#define INDEX_HIGH …
#define INDEX_LOW …
#else
#define INDEX_HIGH …
#define INDEX_LOW …
#endif
#define ADD128(rh, rl, ih, il) …
#define MUL32(i1, i2) …
#define PMUL64(rh, rl, i1, i2) …
#define MUL64(rh, rl, i1, i2) …
#ifdef CONFIG_64BIT
#define nh_16(mp, kp, nw, rh, rl) …
#define nh_16_2(mp, kp, nw, rh, rl, rh1, rl1) …
#if (VMAC_NHBYTES >= 64)
#define nh_vmac_nhbytes(mp, kp, nw, rh, rl) …
#define nh_vmac_nhbytes_2(mp, kp, nw, rh, rl, rh1, rl1) …
#endif
#define poly_step(ah, al, kh, kl, mh, ml) …
#else
#ifndef nh_16
#define nh_16 …
#endif
static void poly_step_func(u64 *ahi, u64 *alo,
const u64 *kh, const u64 *kl,
const u64 *mh, const u64 *ml)
{
#define a0 …
#define a1 …
#define a2 …
#define a3 …
#define k0 …
#define k1 …
#define k2 …
#define k3 …
u64 p, q, t;
u32 t2;
p = MUL32(a3, k3);
p += p;
p += *(u64 *)mh;
p += MUL32(a0, k2);
p += MUL32(a1, k1);
p += MUL32(a2, k0);
t = (u32)(p);
p >>= 32;
p += MUL32(a0, k3);
p += MUL32(a1, k2);
p += MUL32(a2, k1);
p += MUL32(a3, k0);
t |= ((u64)((u32)p & 0x7fffffff)) << 32;
p >>= 31;
p += (u64)(((u32 *)ml)[INDEX_LOW]);
p += MUL32(a0, k0);
q = MUL32(a1, k3);
q += MUL32(a2, k2);
q += MUL32(a3, k1);
q += q;
p += q;
t2 = (u32)(p);
p >>= 32;
p += (u64)(((u32 *)ml)[INDEX_HIGH]);
p += MUL32(a0, k1);
p += MUL32(a1, k0);
q = MUL32(a2, k3);
q += MUL32(a3, k2);
q += q;
p += q;
*(u64 *)(alo) = (p << 32) | t2;
p >>= 32;
*(u64 *)(ahi) = p + t;
#undef a0
#undef a1
#undef a2
#undef a3
#undef k0
#undef k1
#undef k2
#undef k3
}
#define poly_step …
#endif
#ifndef nh_16_2
#define nh_16_2 …
#endif
#ifndef nh_vmac_nhbytes
#define nh_vmac_nhbytes …
#endif
#ifndef nh_vmac_nhbytes_2
#define nh_vmac_nhbytes_2 …
#endif
static u64 l3hash(u64 p1, u64 p2, u64 k1, u64 k2, u64 len)
{ … }
static void vhash_blocks(const struct vmac_tfm_ctx *tctx,
struct vmac_desc_ctx *dctx,
const __le64 *mptr, unsigned int blocks)
{ … }
static int vmac_setkey(struct crypto_shash *tfm,
const u8 *key, unsigned int keylen)
{ … }
static int vmac_init(struct shash_desc *desc)
{ … }
static int vmac_update(struct shash_desc *desc, const u8 *p, unsigned int len)
{ … }
static u64 vhash_final(const struct vmac_tfm_ctx *tctx,
struct vmac_desc_ctx *dctx)
{ … }
static int vmac_final(struct shash_desc *desc, u8 *out)
{ … }
static int vmac_init_tfm(struct crypto_tfm *tfm)
{ … }
static void vmac_exit_tfm(struct crypto_tfm *tfm)
{ … }
static int vmac_create(struct crypto_template *tmpl, struct rtattr **tb)
{ … }
static struct crypto_template vmac64_tmpl = …;
static int __init vmac_module_init(void)
{ … }
static void __exit vmac_module_exit(void)
{ … }
subsys_initcall(vmac_module_init);
module_exit(vmac_module_exit);
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_ALIAS_CRYPTO(…) …;
MODULE_IMPORT_NS(…);