summaryrefslogtreecommitdiff
path: root/include/crypto/sha2.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/crypto/sha2.h')
-rw-r--r--include/crypto/sha2.h20
1 files changed, 6 insertions, 14 deletions
diff --git a/include/crypto/sha2.h b/include/crypto/sha2.h
index b9e9281d76c9..abbd882f7849 100644
--- a/include/crypto/sha2.h
+++ b/include/crypto/sha2.h
@@ -19,6 +19,7 @@
#define SHA512_DIGEST_SIZE 64
#define SHA512_BLOCK_SIZE 128
+#define SHA512_STATE_SIZE 80
#define SHA224_H0 0xc1059ed8UL
#define SHA224_H1 0x367cd507UL
@@ -64,6 +65,11 @@ extern const u8 sha384_zero_message_hash[SHA384_DIGEST_SIZE];
extern const u8 sha512_zero_message_hash[SHA512_DIGEST_SIZE];
+struct crypto_sha256_state {
+ u32 state[SHA256_DIGEST_SIZE / 4];
+ u64 count;
+};
+
struct sha256_state {
u32 state[SHA256_DIGEST_SIZE / 4];
u64 count;
@@ -76,20 +82,6 @@ struct sha512_state {
u8 buf[SHA512_BLOCK_SIZE];
};
-struct shash_desc;
-
-extern int crypto_sha256_update(struct shash_desc *desc, const u8 *data,
- unsigned int len);
-
-extern int crypto_sha256_finup(struct shash_desc *desc, const u8 *data,
- unsigned int len, u8 *hash);
-
-extern int crypto_sha512_update(struct shash_desc *desc, const u8 *data,
- unsigned int len);
-
-extern int crypto_sha512_finup(struct shash_desc *desc, const u8 *data,
- unsigned int len, u8 *hash);
-
/*
* Stand-alone implementation of the SHA256 algorithm. It is designed to
* have as little dependencies as possible so it can be used in the