aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Hamburg <mike@shiftleft.org>2019-06-19 18:11:25 -0700
committerMike Hamburg <mike@shiftleft.org>2019-06-19 18:11:25 -0700
commit760a61ed4a1f4499084dddb2f77d5e07bb91455c (patch)
treeafe866a69d8f9b876a07630e1c21b633ebba46d6
parentalso remove X_SER_BYTES while were at it (diff)
downloadgoldilocks-760a61ed4a1f4499084dddb2f77d5e07bb91455c.tar.xz
goldilocks-760a61ed4a1f4499084dddb2f77d5e07bb91455c.zip
fix issues when compiling on GCC 9.1
-rw-r--r--src/public_include/decaf/common.h3
-rw-r--r--test/test_decaf.cxx10
2 files changed, 7 insertions, 6 deletions
diff --git a/src/public_include/decaf/common.h b/src/public_include/decaf/common.h
index 4de3ebb..2493525 100644
--- a/src/public_include/decaf/common.h
+++ b/src/public_include/decaf/common.h
@@ -115,7 +115,8 @@ decaf_succeed_if(decaf_bool_t x) {
/** Return DECAF_TRUE iff x == DECAF_SUCCESS */
static DECAF_INLINE decaf_bool_t
decaf_successful(decaf_error_t e) {
- decaf_dword_t w = ((decaf_word_t)e) ^ ((decaf_word_t)DECAF_SUCCESS);
+ decaf_word_t succ = DECAF_SUCCESS;
+ decaf_dword_t w = ((decaf_word_t)e) ^ succ;
return (w-1)>>DECAF_WORD_BITS;
}
diff --git a/test/test_decaf.cxx b/test/test_decaf.cxx
index e2a3c27..9c16be5 100644
--- a/test/test_decaf.cxx
+++ b/test/test_decaf.cxx
@@ -327,7 +327,7 @@ static void test_ec() {
Point f((FixedBlock<sizeof(enc)>(enc)));
test.fail();
printf(" Allowed deserialize of [1]: %d", f==id);
- } catch (CryptoException) {
+ } catch (CryptoException&) {
/* ok */
}
@@ -336,7 +336,7 @@ static void test_ec() {
Point f(sqrt_minus_one);
test.fail();
printf(" Allowed deserialize of [i]: %d", f==id);
- } catch (CryptoException) {
+ } catch (CryptoException&) {
/* ok */
}
}
@@ -346,7 +346,7 @@ static void test_ec() {
Point f(minus_sqrt_minus_one);
test.fail();
printf(" Allowed deserialize of [-i]: %d", f==id);
- } catch (CryptoException) {
+ } catch (CryptoException&) {
/* ok */
}
}
@@ -365,7 +365,7 @@ static void test_ec() {
try {
point_check(test,p,q,r,0,0,p,Point(p.serialize()),"round-trip");
- } catch (CryptoException) {
+ } catch (CryptoException&) {
test.fail();
printf(" Round-trip raised CryptoException!\n");
}
@@ -408,7 +408,7 @@ static void test_ec() {
try {
point_check(test,p,q,r,x,0,Point(x.direct_scalarmul(p.serialize())),x*p,"direct mul");
- } catch (CryptoException) {
+ } catch (CryptoException&) {
printf(" Direct mul raised CryptoException!\n");
test.fail();
}