diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-04-11 18:13:45 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-04-11 18:13:45 -0400 |
commit | d39f7138063125b92f738715ca1bcd53f5ef147c (patch) | |
tree | ca2f39df2c3525416c57cc4aa98408bb392f3562 /configure.ac | |
parent | f2e7271dcad8a8a79fddd253e602c64297e691ad (diff) | |
parent | a1178cdbcf1f99715204567152635a57c705af0e (diff) | |
download | tor-d39f7138063125b92f738715ca1bcd53f5ef147c.tar.gz tor-d39f7138063125b92f738715ca1bcd53f5ef147c.zip |
Merge remote-tracking branch 'origin/maint-0.2.4'
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac index 91fba79cdc..03155dc892 100644 --- a/configure.ac +++ b/configure.ac @@ -676,30 +676,38 @@ if test x$enable_curve25519 != xno; then [AC_LANG_PROGRAM([dnl #include <stdint.h> typedef unsigned uint128_t __attribute__((mode(TI))); + int func(uint64_t a, uint64_t b) { + uint128_t c = ((uint128_t)a) * b; + int ok = ((uint64_t)(c>>96)) == 522859 && + (((uint64_t)(c>>64))&0xffffffffL) == 3604448702L && + (((uint64_t)(c>>32))&0xffffffffL) == 2351960064L && + (((uint64_t)(c))&0xffffffffL) == 0; + return ok; + } ], [dnl - uint64_t a = ((uint64_t)2000000000) * 1000000000; - uint64_t b = ((uint64_t)1234567890) << 24; - uint128_t c = ((uint128_t)a) * b; - return ((uint64_t)(c>>96)) == 522859 && - ((uint64_t)(c>>64))&0xffffffffL == 3604448702L && - ((uint64_t)(c>>32))&0xffffffffL == 2351960064L && - ((uint64_t)(c))&0xffffffffL == 0; + int ok = func( ((uint64_t)2000000000) * 1000000000, + ((uint64_t)1234567890) << 24); + return !ok; ])], [tor_cv_can_use_curve25519_donna_c64=yes], [tor_cv_can_use_curve25519_donna_c64=no], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([dnl - #include <stdint.h> - typedef unsigned uint128_t __attribute__((mode(TI))); - ], [dnl - uint64_t a = ((uint64_t)2000000000) * 1000000000; - uint64_t b = ((uint64_t)1234567890) << 24; - uint128_t c = ((uint128_t)a) * b; - return ((uint64_t)(c>>96)) == 522859 && - ((uint64_t)(c>>64))&0xffffffffL == 3604448702L && - ((uint64_t)(c>>32))&0xffffffffL == 2351960064L && - ((uint64_t)(c))&0xffffffffL == 0; - ])], + #include <stdint.h> + typedef unsigned uint128_t __attribute__((mode(TI))); + int func(uint64_t a, uint64_t b) { + uint128_t c = ((uint128_t)a) * b; + int ok = ((uint64_t)(c>>96)) == 522859 && + (((uint64_t)(c>>64))&0xffffffffL) == 3604448702L && + (((uint64_t)(c>>32))&0xffffffffL) == 2351960064L && + (((uint64_t)(c))&0xffffffffL) == 0; + return ok; + } + ], [dnl + int ok = func( ((uint64_t)2000000000) * 1000000000, + ((uint64_t)1234567890) << 24); + return !ok; + ])], [tor_cv_can_use_curve25519_donna_c64=cross], [tor_cv_can_use_curve25519_donna_c64=no])])]) |