Commit 90407942 authored by Michael Graff's avatar Michael Graff

Use autoconf's AC_C_BIGENDIAN macro to detect endian flavor, and use...

Use autoconf's AC_C_BIGENDIAN macro to detect endian flavor, and use WORDS_BIGENDIAN from config.h{,.in}
parent 9fde61b0
......@@ -36,6 +36,10 @@
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define if your processor stores words with the most significant
byte first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
/* define on DEC OSF to enable 4.4BSD style sa_len support */
#undef _SOCKADDR_LEN
......@@ -94,9 +98,6 @@ int sigwait(const unsigned int *set, int *sig);
} while (0)
#endif /* SHUTUP_STDARG_CAST && __GNUC__ */
/* Define if you have the <endian.h> header file. */
#undef HAVE_ENDIAN_H
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
......@@ -106,9 +107,6 @@ int sigwait(const unsigned int *set, int *sig);
/* Define if you have the <linux/prctl.h> header file. */
#undef HAVE_LINUX_PRCTL_H
/* Define if you have the <sys/endian.h> header file. */
#undef HAVE_SYS_ENDIAN_H
/* Define if you have the <sys/sockio.h> header file. */
#undef HAVE_SYS_SOCKIO_H
......
This diff is collapsed.
......@@ -13,7 +13,7 @@ dnl PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
dnl ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
dnl SOFTWARE.
AC_REVISION($Revision: 1.145 $)
AC_REVISION($Revision: 1.146 $)
AC_PREREQ(2.13)
......@@ -155,6 +155,11 @@ if test "X$CC" = "X" ; then
esac
fi
#
# Find the machine's endian flavor.
#
AC_C_BIGENDIAN
#
# If the user didn't specify where openssl is, and we didn't find or it
# is imcompatible with our code, use our internal one.
......@@ -245,7 +250,7 @@ AC_PROG_YACC
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h endian.h sys/endian.h sys/sockio.h)
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/sockio.h)
AC_C_CONST
AC_C_INLINE
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: sha1.c,v 1.5 2000/06/07 02:28:40 bwelling Exp $ */
/* $Id: sha1.c,v 1.6 2000/06/07 19:41:49 explorer Exp $ */
/* $NetBSD: sha1.c,v 1.5 2000/01/22 22:19:14 mycroft Exp $ */
/* $OpenBSD: sha1.c,v 1.9 1997/07/23 21:12:32 kstailey Exp $ */
......@@ -42,35 +42,13 @@
#include <isc/types.h>
#include <isc/util.h>
#if defined(HAVE_ENDIAN_H)
#include <endian.h>
#elif defined(HAVE_SYS_ENDIAN_H)
#include <sys/endian.h>
#endif
#if !defined(BYTE_ORDER) && defined(__BYTE_ORDER)
#define BYTE_ORDER __BYTE_ORDER
#define LITTLE_ENDIAN __LITTLE_ENDIAN
#define BIG_ENDIAN __BIG_ENDIAN
#endif
#if !defined(BYTE_ORDER) || \
(BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN)
/* you must determine what the correct bit order is for
* your compiler - the next line is an intentional error
* which will force your compiles to bomb until you fix
* the above macros.
*/
#error "Undefined or invalid BYTE_ORDER";
#endif
#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
/*
* blk0() and blk() perform the initial expand.
* I got the idea of expanding during the round function from SSLeay
*/
#if BYTE_ORDER == LITTLE_ENDIAN
#if !defined(WORDS_BIGENDIAN)
# define blk0(i) \
(block->l[i] = (rol(block->l[i], 24) & 0xFF00FF00) \
| (rol(block->l[i], 8) & 0x00FF00FF))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment