21 #include <linux/module.h>
24 #include <linux/types.h>
25 #include <crypto/sha.h>
26 #include <asm/byteorder.h>
30 struct sha1_state *sctx = shash_desc_ctx(desc);
42 struct sha1_state *sctx = shash_desc_ctx(desc);
43 unsigned int partial,
done;
67 memset(temp, 0,
sizeof(temp));
80 struct sha1_state *sctx = shash_desc_ctx(desc);
89 index = sctx->
count & 0x3f;
90 padlen = (index < 56) ? (56 - index) : ((64+56) - index);
97 for (i = 0; i < 5; i++)
101 memset(sctx, 0,
sizeof *sctx);
106 static int sha1_export(
struct shash_desc *desc,
void *out)
108 struct sha1_state *sctx = shash_desc_ctx(desc);
110 memcpy(out, sctx,
sizeof(*sctx));
114 static int sha1_import(
struct shash_desc *desc,
const void *
in)
116 struct sha1_state *sctx = shash_desc_ctx(desc);
118 memcpy(sctx, in,
sizeof(*sctx));
127 .export = sha1_export,
128 .import = sha1_import,
133 .cra_driver_name=
"sha1-generic",
140 static int __init sha1_generic_mod_init(
void)
145 static void __exit sha1_generic_mod_fini(
void)