summaryrefslogtreecommitdiff
path: root/lib/md4.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-06-17 14:35:37 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2018-06-17 14:38:05 -0700
commit0d45ec7c033c165ad73a6509c7fa84aa67edf4ea (patch)
treec0177a94dcfb05477b64bc2cbbe8576753b74907 /lib/md4.c
parentb80cc10aeb8dd2b94bf0be2a5d0b2efb95965e24 (diff)
downloadgnulib-0d45ec7c033c165ad73a6509c7fa84aa67edf4ea.tar.gz
crypto: use byteswap
* lib/md4.c, lib/md5.c, lib/sha1.c, lib/sha256.c, lib/sha512.c: * lib/sm3.c: Include <byteswap.h>. (SWAP): Use its macros rather than reinventing the wheel. * modules/crypto/md4, modules/crypto/md5-buffer: * modules/crypto/sha1-buffer, modules/crypto/sha256-buffer: * modules/crypto/sha512-buffer, modules/crypto/sm3: (Depends-on): Add byteswap.
Diffstat (limited to 'lib/md4.c')
-rw-r--r--lib/md4.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/md4.c b/lib/md4.c
index b24ad1ca50..6474e6387f 100644
--- a/lib/md4.c
+++ b/lib/md4.c
@@ -33,9 +33,9 @@
# include "unlocked-io.h"
#endif
+#include <byteswap.h>
#ifdef WORDS_BIGENDIAN
-# define SWAP(n) \
- (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
+# define SWAP(n) bswap_32 (n)
#else
# define SWAP(n) (n)
#endif