#define pr_fmt(fmt) …
#include <crypto/internal/hash.h>
#include <crypto/internal/simd.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/types.h>
#include <crypto/sha1.h>
#include <crypto/sha1_base.h>
#include <asm/cpu_device_id.h>
#include <asm/simd.h>
static const struct x86_cpu_id module_cpu_ids[] = …;
MODULE_DEVICE_TABLE(x86cpu, module_cpu_ids);
static int sha1_update(struct shash_desc *desc, const u8 *data,
unsigned int len, sha1_block_fn *sha1_xform)
{ … }
static int sha1_finup(struct shash_desc *desc, const u8 *data,
unsigned int len, u8 *out, sha1_block_fn *sha1_xform)
{ … }
asmlinkage void sha1_transform_ssse3(struct sha1_state *state,
const u8 *data, int blocks);
static int sha1_ssse3_update(struct shash_desc *desc, const u8 *data,
unsigned int len)
{ … }
static int sha1_ssse3_finup(struct shash_desc *desc, const u8 *data,
unsigned int len, u8 *out)
{ … }
static int sha1_ssse3_final(struct shash_desc *desc, u8 *out)
{ … }
static struct shash_alg sha1_ssse3_alg = …;
static int register_sha1_ssse3(void)
{ … }
static void unregister_sha1_ssse3(void)
{ … }
asmlinkage void sha1_transform_avx(struct sha1_state *state,
const u8 *data, int blocks);
static int sha1_avx_update(struct shash_desc *desc, const u8 *data,
unsigned int len)
{ … }
static int sha1_avx_finup(struct shash_desc *desc, const u8 *data,
unsigned int len, u8 *out)
{ … }
static int sha1_avx_final(struct shash_desc *desc, u8 *out)
{ … }
static struct shash_alg sha1_avx_alg = …;
static bool avx_usable(void)
{ … }
static int register_sha1_avx(void)
{ … }
static void unregister_sha1_avx(void)
{ … }
#define SHA1_AVX2_BLOCK_OPTSIZE …
asmlinkage void sha1_transform_avx2(struct sha1_state *state,
const u8 *data, int blocks);
static bool avx2_usable(void)
{ … }
static void sha1_apply_transform_avx2(struct sha1_state *state,
const u8 *data, int blocks)
{ … }
static int sha1_avx2_update(struct shash_desc *desc, const u8 *data,
unsigned int len)
{ … }
static int sha1_avx2_finup(struct shash_desc *desc, const u8 *data,
unsigned int len, u8 *out)
{ … }
static int sha1_avx2_final(struct shash_desc *desc, u8 *out)
{ … }
static struct shash_alg sha1_avx2_alg = …;
static int register_sha1_avx2(void)
{ … }
static void unregister_sha1_avx2(void)
{ … }
#ifdef CONFIG_AS_SHA1_NI
asmlinkage void sha1_ni_transform(struct sha1_state *digest, const u8 *data,
int rounds);
static int sha1_ni_update(struct shash_desc *desc, const u8 *data,
unsigned int len)
{ … }
static int sha1_ni_finup(struct shash_desc *desc, const u8 *data,
unsigned int len, u8 *out)
{ … }
static int sha1_ni_final(struct shash_desc *desc, u8 *out)
{ … }
static struct shash_alg sha1_ni_alg = …;
static int register_sha1_ni(void)
{ … }
static void unregister_sha1_ni(void)
{ … }
#else
static inline int register_sha1_ni(void) { return 0; }
static inline void unregister_sha1_ni(void) { }
#endif
static int __init sha1_ssse3_mod_init(void)
{ … }
static void __exit sha1_ssse3_mod_fini(void)
{ … }
module_init(…) …;
module_exit(sha1_ssse3_mod_fini);
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_ALIAS_CRYPTO(…) …;
MODULE_ALIAS_CRYPTO(…) …;
MODULE_ALIAS_CRYPTO(…) …;
MODULE_ALIAS_CRYPTO(…) …;
#ifdef CONFIG_AS_SHA1_NI
MODULE_ALIAS_CRYPTO(…) …;
#endif