Rather than checking for emscripten, perform a 128-bit mul
This commit is contained in:
parent
5f5d36a9bb
commit
d73d5f8ee6
@ -644,10 +644,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
|||||||
#ifndef NATIVE_LITTLE_ENDIAN
|
#ifndef NATIVE_LITTLE_ENDIAN
|
||||||
# error libsodium currently expects a little endian CPU for the 128-bit type
|
# error libsodium currently expects a little endian CPU for the 128-bit type
|
||||||
#endif
|
#endif
|
||||||
#ifdef __EMSCRIPTEN__
|
|
||||||
# error emscripten currently supports only shift operations on integers \
|
|
||||||
# larger than 64 bits
|
|
||||||
#endif
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#if defined(__SIZEOF_INT128__)
|
#if defined(__SIZEOF_INT128__)
|
||||||
@ -657,6 +653,8 @@ typedef unsigned uint128_t __attribute__((mode(TI)));
|
|||||||
#endif
|
#endif
|
||||||
void fcontract(uint128_t *t) {
|
void fcontract(uint128_t *t) {
|
||||||
*t += 0x8000000000000 - 1;
|
*t += 0x8000000000000 - 1;
|
||||||
|
*t *= *t;
|
||||||
|
*t >>= 84;
|
||||||
}
|
}
|
||||||
]], [[
|
]], [[
|
||||||
(void) fcontract;
|
(void) fcontract;
|
||||||
|
Loading…
Reference in New Issue
Block a user