aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-03-25 10:07:41 -0400
committerNick Mathewson <nickm@torproject.org>2013-03-25 10:07:41 -0400
commite9e430403cb70e18ae3c22e47d24c189be8e492c (patch)
tree4a26525bf33e4c78c4835d56b78ba7e8c097c7a2 /configure.ac
parent8b6a952c94bbc7bd3a9dc3356e708654092e08af (diff)
downloadtor-e9e430403cb70e18ae3c22e47d24c189be8e492c.tar
tor-e9e430403cb70e18ae3c22e47d24c189be8e492c.tar.gz
Fix two dump bugs in "whether we can use curve25519-donna-c64" test
Dumb bug 1: == has higher precedence than &. Dumb bug 2: the main() function in an AC_RUN_IFELSE test is expected to return 0 on success, not 1.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 10 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index ed452cb54..8a79653e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -667,10 +667,11 @@ if test x$enable_curve25519 != xno; then
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 = ((uint64_t)(c>>96)) == 522859 &&
+ (((uint64_t)(c>>64))&0xffffffffL) == 3604448702L &&
+ (((uint64_t)(c>>32))&0xffffffffL) == 2351960064L &&
+ (((uint64_t)(c))&0xffffffffL) == 0;
+ return !ok;
])],
[tor_cv_can_use_curve25519_donna_c64=yes],
[tor_cv_can_use_curve25519_donna_c64=no],
@@ -682,10 +683,11 @@ if test x$enable_curve25519 != xno; then
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 = ((uint64_t)(c>>96)) == 522859 &&
+ (((uint64_t)(c>>64))&0xffffffffL) == 3604448702L &&
+ (((uint64_t)(c>>32))&0xffffffffL) == 2351960064L &&
+ (((uint64_t)(c))&0xffffffffL) == 0;
+ return !ok;
])],
[tor_cv_can_use_curve25519_donna_c64=cross],
[tor_cv_can_use_curve25519_donna_c64=no])])])