From b358450114fc442315aa69066f23b07cbffb63e5 Mon Sep 17 00:00:00 2001 From: Eric Lombrozo Date: Mon, 18 Mar 2013 07:31:33 -0700 Subject: [PATCH] First cast the conditional to an int64 so it works on 32-bit platforms. --- field.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/field.cpp b/field.cpp index 91e9b0d..67a8644 100644 --- a/field.cpp +++ b/field.cpp @@ -100,7 +100,7 @@ void FieldElem::Normalize() { n[0] = t0; n[1] = t1; n[2] = t2; n[3] = t3; n[4] = t4; // Subtract p if result >= p - uint64_t mask = (uint64_t)~(-(n[4] == 0xFFFFFFFFFFFFULL && n[3] == 0xFFFFFFFFFFFFFULL && n[2] == 0xFFFFFFFFFFFFFULL && n[1] == 0xFFFFFFFFFFFFF && n[0] >= 0xFFFFEFFFFFC2FULL)); + uint64_t mask = (uint64_t)~(-(int64_t)(n[4] == 0xFFFFFFFFFFFFULL && n[3] == 0xFFFFFFFFFFFFFULL && n[2] == 0xFFFFFFFFFFFFFULL && n[1] == 0xFFFFFFFFFFFFF && n[0] >= 0xFFFFEFFFFFC2FULL)); n[4] &= mask; n[3] &= mask; n[2] &= mask;