linux/crypto/crc32_generic.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright 2012 Xyratex Technology Limited
 */

/*
 * This is crypto api shash wrappers to crc32_le.
 */

#include <asm/unaligned.h>
#include <linux/crc32.h>
#include <crypto/internal/hash.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/kernel.h>

#define CHKSUM_BLOCK_SIZE
#define CHKSUM_DIGEST_SIZE

/** No default init with ~0 */
static int crc32_cra_init(struct crypto_tfm *tfm)
{}

/*
 * Setting the seed allows arbitrary accumulators and flexible XOR policy
 * If your algorithm starts with ~0, then XOR with ~0 before you set
 * the seed.
 */
static int crc32_setkey(struct crypto_shash *hash, const u8 *key,
			unsigned int keylen)
{}

static int crc32_init(struct shash_desc *desc)
{}

static int crc32_update(struct shash_desc *desc, const u8 *data,
			unsigned int len)
{}

/* No final XOR 0xFFFFFFFF, like crc32_le */
static int __crc32_finup(u32 *crcp, const u8 *data, unsigned int len,
			 u8 *out)
{}

static int crc32_finup(struct shash_desc *desc, const u8 *data,
		       unsigned int len, u8 *out)
{}

static int crc32_final(struct shash_desc *desc, u8 *out)
{}

static int crc32_digest(struct shash_desc *desc, const u8 *data,
			unsigned int len, u8 *out)
{}
static struct shash_alg alg =;

static int __init crc32_mod_init(void)
{}

static void __exit crc32_mod_fini(void)
{}

subsys_initcall(crc32_mod_init);
module_exit(crc32_mod_fini);

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_ALIAS_CRYPTO();
MODULE_ALIAS_CRYPTO();