From d73d5f8ee680a41bbd26d3944f4ae59f0239ebae Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 27 Dec 2017 00:10:18 +0100 Subject: [PATCH] Rather than checking for emscripten, perform a 128-bit mul --- configure.ac | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 479dc64f..923adfe1 100644 --- a/configure.ac +++ b/configure.ac @@ -644,10 +644,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifndef NATIVE_LITTLE_ENDIAN # error libsodium currently expects a little endian CPU for the 128-bit type #endif -#ifdef __EMSCRIPTEN__ -# error emscripten currently supports only shift operations on integers \ -# larger than 64 bits -#endif #include #include #if defined(__SIZEOF_INT128__) @@ -657,6 +653,8 @@ typedef unsigned uint128_t __attribute__((mode(TI))); #endif void fcontract(uint128_t *t) { *t += 0x8000000000000 - 1; + *t *= *t; + *t >>= 84; } ]], [[ (void) fcontract;