aboutsummaryrefslogtreecommitdiff
path: root/lib/sha256.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-05-14 00:05:04 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-05-15 08:54:42 +0200
commit8df455479f8801bbebad8839fc96abbffa711603 (patch)
treead0fcac278779ef75726f8aec6a061453c043282 /lib/sha256.c
parent5d54b5e6971cf26b35d11980d6953bf436419752 (diff)
source cleanup: remove all custom typedef structs
- Stick to a single unified way to use structs - Make checksrc complain on 'typedef struct {' - Allow them in tests, public headers and examples - Let MD4_CTX, MD5_CTX, and SHA256_CTX typedefs remain as they actually typedef different types/structs depending on build conditions. Closes #5338
Diffstat (limited to 'lib/sha256.c')
-rw-r--r--lib/sha256.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/sha256.c b/lib/sha256.c
index 00d98ce46..a3be92a4e 100644
--- a/lib/sha256.c
+++ b/lib/sha256.c
@@ -196,10 +196,11 @@ static void SHA256_Final(unsigned char *digest, SHA256_CTX *ctx)
#include <wincrypt.h>
-typedef struct {
+struct sha256_ctx {
HCRYPTPROV hCryptProv;
HCRYPTHASH hHash;
-} SHA256_CTX;
+};
+typedef struct sha256_ctx SHA256_CTX;
#if !defined(CALG_SHA_256)
#define CALG_SHA_256 0x0000800c
@@ -280,7 +281,7 @@ do { \
} while(0)
#endif
-typedef struct sha256_state {
+struct sha256_state {
#ifdef HAVE_LONGLONG
unsigned long long length;
#else
@@ -288,7 +289,8 @@ typedef struct sha256_state {
#endif
unsigned long state[8], curlen;
unsigned char buf[64];
-} SHA256_CTX;
+};
+typedef struct sha256_state SHA256_CTX;
/* The K array */
static const unsigned long K[64] = {