]> andersk Git - openssh.git/commitdiff
- (djm) [configure.ac umac.c] If platform doesn't provide swap32(3), then
authordjm <djm>
Mon, 11 Jun 2007 04:15:42 +0000 (04:15 +0000)
committerdjm <djm>
Mon, 11 Jun 2007 04:15:42 +0000 (04:15 +0000)
   fallback to provided bit-swizzing functions

ChangeLog
configure.ac
umac.c

index 4b92e4dbb7a9df459c127298aff100067e22a8fe..c4e845f7645677612cb262dae567445dc3121b7e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,8 @@
      [sshd_config.5]
      oops, here too: put the MAC list into a display, like we do for
      ciphers, since groff has trouble with wide lines;
+ - (djm) [configure.ac umac.c] If platform doesn't provide swap32(3), then
+   fallback to provided bit-swizzing functions
 
 20070605
  - (dtucker) OpenBSD CVS Sync
index 3ed251949390eee38cfe273b9b4ada78b80d03de..b09666f0aa941a5bca3de01a2e7e76ba335545aa 100644 (file)
@@ -1300,6 +1300,7 @@ AC_CHECK_FUNCS( \
        strtonum \
        strtoll \
        strtoul \
+       swap32 \
        sysconf \
        tcgetpgrp \
        truncate \
diff --git a/umac.c b/umac.c
index 676705c9cbb5882bdb730a71e145f3f27059c24d..29c202a2194f144daf19ff506462db91e83e2142 100644 (file)
--- a/umac.c
+++ b/umac.c
@@ -122,7 +122,11 @@ typedef unsigned int       UWORD;  /* Register */
 /* --- Endian Conversion --- Forcing assembly on some platforms           */
 /* ---------------------------------------------------------------------- */
 
-#if 0
+#if HAVE_SWAP32
+#define LOAD_UINT32_REVERSED(p)                (swap32(*(UINT32 *)(p)))
+#define STORE_UINT32_REVERSED(p,v)     (*(UINT32 *)(p) = swap32(v))
+#else /* HAVE_SWAP32 */
+
 static UINT32 LOAD_UINT32_REVERSED(void *ptr)
 {
     UINT32 temp = *(UINT32 *)ptr;
@@ -137,15 +141,12 @@ static void STORE_UINT32_REVERSED(void *ptr, UINT32 x)
     *(UINT32 *)ptr = (i >> 24) | ((i & 0x00FF0000) >> 8 )
                    | ((i & 0x0000FF00) << 8 ) | (i << 24);
 }
-#endif
+#endif /* HAVE_SWAP32 */
 
 /* The following definitions use the above reversal-primitives to do the right
  * thing on endian specific load and stores.
  */
 
-#define LOAD_UINT32_REVERSED(p)                (swap32(*(UINT32 *)(p)))
-#define STORE_UINT32_REVERSED(p,v)     (*(UINT32 *)(p) = swap32(v))
-
 #if (__LITTLE_ENDIAN__)
 #define LOAD_UINT32_LITTLE(ptr)     (*(UINT32 *)(ptr))
 #define STORE_UINT32_BIG(ptr,x)     STORE_UINT32_REVERSED(ptr,x)
@@ -154,8 +155,6 @@ static void STORE_UINT32_REVERSED(void *ptr, UINT32 x)
 #define STORE_UINT32_BIG(ptr,x)     (*(UINT32 *)(ptr) = (UINT32)(x))
 #endif
 
-
-
 /* ---------------------------------------------------------------------- */
 /* ---------------------------------------------------------------------- */
 /* ----- Begin KDF & PDF Section ---------------------------------------- */
This page took 0.105337 seconds and 5 git commands to generate.