commit cb6b80ab4e369d3b44e6bb0caae433926806d867
parent 6f92232a24d18f0dc454023c11da8fa311a987ba
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];