From 20b23cc32edd4ad8aed1699b3b5d372efeac5c67 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 11 Mar 2022 11:23:47 -0500 Subject: Fix SHA1 calculation on big-endian systems Add the AC_C_BIGENDIAN macro to determine endianness and set WORDS_BIGENDIAN accordingly. Fixes GitHub issue #397. Signed-off-by: Lukas Fleischer --- configure.ac | 1 + src/sha1.c | 1 + 2 files changed, 2 insertions(+) diff --git a/configure.ac b/configure.ac index 7405450..e7594c5 100644 --- a/configure.ac +++ b/configure.ac @@ -19,6 +19,7 @@ AC_CANONICAL_HOST # Checks for programs #------------------------------------------------------------------------------- AC_PROG_CC +AC_C_BIGENDIAN #------------------------------------------------------------------------------- # Checks for header files #------------------------------------------------------------------------------- diff --git a/src/sha1.c b/src/sha1.c index 3826c76..6a5f0e3 100644 --- a/src/sha1.c +++ b/src/sha1.c @@ -43,6 +43,7 @@ #include #include +#include "config.h" #include "sha1.h" #define rol(val, n) (((val) << (n)) | ((val) >> (32 - (n)))) -- cgit v1.2.3-70-g09d2