From 98c175e69225aae3eecb23341212f83697b75d38 Mon Sep 17 00:00:00 2001 From: Quaylyn Rimer <31830590+killerdevildog@users.noreply.github.com> Date: Sat, 12 Sep 2026 02:24:51 -0600 Subject: [PATCH] [rcore] Fix ComputeSHA256() wrong hash when message length mod 64 is 56..59 (#6144) --- src/rcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rcore.c b/src/rcore.c index 4f6396ee9..41f7da0ee 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -3535,7 +3535,7 @@ unsigned int *ComputeSHA256(const unsigned char *data, int dataSize) hash[7] = 0x5be0cd19; const unsigned long long bitLen = 8ULL*dataSize; - unsigned long long paddedSize = dataSize + sizeof(dataSize); + unsigned long long paddedSize = dataSize + sizeof(bitLen); // Reserve room for the 64 bit message length appended at the end paddedSize += (64 - (paddedSize%64)); unsigned char *buffer = (unsigned char *)RL_CALLOC(paddedSize, sizeof(unsigned char));