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 <lfleischer@calcurse.org>
This commit is contained in:
Lukas Fleischer 2022-03-11 11:23:47 -05:00
parent bea7349211
commit 20b23cc32e
2 changed files with 2 additions and 0 deletions

View File

@ -19,6 +19,7 @@ AC_CANONICAL_HOST
# Checks for programs
#-------------------------------------------------------------------------------
AC_PROG_CC
AC_C_BIGENDIAN
#-------------------------------------------------------------------------------
# Checks for header files
#-------------------------------------------------------------------------------

View File

@ -43,6 +43,7 @@
#include <stdlib.h>
#include <string.h>
#include "config.h"
#include "sha1.h"
#define rol(val, n) (((val) << (n)) | ((val) >> (32 - (n))))