commit 917c813c88a5d33f47e68cba0affcbc5aa761841
parent f46c7b67011a454299aab1da0b491b73e3458888
Author: finwo <finwo@pm.me>
Date: Sat, 10 Jan 2026 22:31:15 +0100
Merge pull request #21: sha256: Use standard types uint8_t / uint32_t so types doesn't have to be adjusted manually
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sha256.h b/sha256.h
@@ -11,13 +11,14 @@
/*************************** HEADER FILES ***************************/
#include <stddef.h>
+#include <stdint.h>
/****************************** MACROS ******************************/
#define SHA256_BLOCK_SIZE 32 // SHA256 outputs a 32 byte digest
/**************************** DATA TYPES ****************************/
-typedef unsigned char BYTE; // 8-bit byte
-typedef unsigned int WORD; // 32-bit word, change to "long" for 16-bit machines
+typedef uint8_t BYTE; // 8-bit byte
+typedef uint32_t WORD; // 32-bit word
typedef struct {
BYTE data[64];