#include <crypto/internal/hash.h>
#include <linux/module.h>
#include <linux/cryptohash.h>
#include <crypto/sha1_base.h>
#include <asm/byteorder.h>
const u8 sha1_zero_message_hash[SHA1_DIGEST_SIZE] = {
0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, 0x0d,
0x32, 0x55, 0xbf, 0xef, 0x95, 0x60, 0x18, 0x90,
EXPORT_SYMBOL_GPL(sha1_zero_message_hash);
static void sha1_generic_block_fn(struct sha1_state *sst, u8 const *src,
u32 temp[SHA_WORKSPACE_WORDS];
sha_transform(sst->state, src, temp);
memzero_explicit(temp, sizeof(temp));
int crypto_sha1_update(struct shash_desc *desc, const u8 *data,
return sha1_base_do_update(desc, data, len, sha1_generic_block_fn);
EXPORT_SYMBOL(crypto_sha1_update);
static int sha1_final(struct shash_desc *desc, u8 *out)
sha1_base_do_finalize(desc, sha1_generic_block_fn);
return sha1_base_finish(desc, out);
int crypto_sha1_finup(struct shash_desc *desc, const u8 *data,
unsigned int len, u8 *out)