From ffb134af3aedadcd04dffa13e59d8f4cef3ee928 Mon Sep 17 00:00:00 2001
From: Michael Hamburg <mike@shiftleft.org>
Date: Tue, 10 Apr 2018 10:56:07 -0400
Subject: [PATCH] minor fixes: fix unreachable code, fix an integer used in
 boolean context, thanks to Sofi Celi

---
 src/GENERATED/c/curve25519/decaf.c        | 2 +-
 src/GENERATED/c/ed448goldilocks/decaf.c   | 2 +-
 src/GENERATED/include/decaf/point_255.hxx | 2 +-
 src/GENERATED/include/decaf/point_448.hxx | 2 +-
 src/per_curve/decaf.tmpl.c                | 2 +-
 src/per_curve/point.tmpl.hxx              | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/GENERATED/c/curve25519/decaf.c b/src/GENERATED/c/curve25519/decaf.c
index d3ab6ac..48b21cf 100644
--- a/src/GENERATED/c/curve25519/decaf.c
+++ b/src/GENERATED/c/curve25519/decaf.c
@@ -763,7 +763,7 @@ decaf_bool_t API_NS(point_eq) ( const point_t p, const point_t q ) {
     gf_mul ( b, q->y, p->x );
     mask_t succ = gf_eq(a,b);
     
-    #if (COFACTOR == 8) && IMAGINE_TWIST
+    #if (COFACTOR == 8)
         gf_mul ( a, p->y, q->y );
         gf_mul ( b, q->x, p->x );
         #if !(IMAGINE_TWIST)
diff --git a/src/GENERATED/c/ed448goldilocks/decaf.c b/src/GENERATED/c/ed448goldilocks/decaf.c
index 2e5bb3f..3952400 100644
--- a/src/GENERATED/c/ed448goldilocks/decaf.c
+++ b/src/GENERATED/c/ed448goldilocks/decaf.c
@@ -763,7 +763,7 @@ decaf_bool_t API_NS(point_eq) ( const point_t p, const point_t q ) {
     gf_mul ( b, q->y, p->x );
     mask_t succ = gf_eq(a,b);
     
-    #if (COFACTOR == 8) && IMAGINE_TWIST
+    #if (COFACTOR == 8)
         gf_mul ( a, p->y, q->y );
         gf_mul ( b, q->x, p->x );
         #if !(IMAGINE_TWIST)
diff --git a/src/GENERATED/include/decaf/point_255.hxx b/src/GENERATED/include/decaf/point_255.hxx
index 905a8bc..8915d30 100644
--- a/src/GENERATED/include/decaf/point_255.hxx
+++ b/src/GENERATED/include/decaf/point_255.hxx
@@ -318,7 +318,7 @@ public:
     */
     inline explicit Point(const FixedBlock<SER_BYTES> &buffer, bool allow_identity=true)
         /*throw(CryptoException)*/ {
-        if (DECAF_SUCCESS != decode(buffer,allow_identity ? DECAF_TRUE : DECAF_FALSE)) {
+        if (DECAF_SUCCESS != decode(buffer,allow_identity)) {
             throw CryptoException();
         }
     }
diff --git a/src/GENERATED/include/decaf/point_448.hxx b/src/GENERATED/include/decaf/point_448.hxx
index a39ca2a..a4a08c5 100644
--- a/src/GENERATED/include/decaf/point_448.hxx
+++ b/src/GENERATED/include/decaf/point_448.hxx
@@ -318,7 +318,7 @@ public:
     */
     inline explicit Point(const FixedBlock<SER_BYTES> &buffer, bool allow_identity=true)
         /*throw(CryptoException)*/ {
-        if (DECAF_SUCCESS != decode(buffer,allow_identity ? DECAF_TRUE : DECAF_FALSE)) {
+        if (DECAF_SUCCESS != decode(buffer,allow_identity)) {
             throw CryptoException();
         }
     }
diff --git a/src/per_curve/decaf.tmpl.c b/src/per_curve/decaf.tmpl.c
index 9bfe4c0..bfc3843 100644
--- a/src/per_curve/decaf.tmpl.c
+++ b/src/per_curve/decaf.tmpl.c
@@ -752,7 +752,7 @@ decaf_bool_t API_NS(point_eq) ( const point_t p, const point_t q ) {
     gf_mul ( b, q->y, p->x );
     mask_t succ = gf_eq(a,b);
     
-    #if (COFACTOR == 8) && IMAGINE_TWIST
+    #if (COFACTOR == 8)
         gf_mul ( a, p->y, q->y );
         gf_mul ( b, q->x, p->x );
         #if !(IMAGINE_TWIST)
diff --git a/src/per_curve/point.tmpl.hxx b/src/per_curve/point.tmpl.hxx
index d481777..2e5c11d 100644
--- a/src/per_curve/point.tmpl.hxx
+++ b/src/per_curve/point.tmpl.hxx
@@ -305,7 +305,7 @@ public:
     */
     inline explicit Point(const FixedBlock<SER_BYTES> &buffer, bool allow_identity=true)
         /*throw(CryptoException)*/ {
-        if (DECAF_SUCCESS != decode(buffer,allow_identity ? DECAF_TRUE : DECAF_FALSE)) {
+        if (DECAF_SUCCESS != decode(buffer,allow_identity)) {
             throw CryptoException();
         }
     }