Skip to content

Commit

Permalink
Always include <gmp.h> before including relic headers (dashpay#21)
Browse files Browse the repository at this point in the history
The relic headers internally include <gmp.h> as well. At the same time,
inclusion of relic headers is wrapped into a namespace, which makes the
gmp headers be part of that namespace as well. This leads to conflicting
definitions of "std::ostream& operator<< (std::ostream &, mpz_srcptr)" and
friends on Debian stretch (if gmp from /usr is used).
  • Loading branch information
codablock authored and mariano54 committed Sep 19, 2018
1 parent f1570df commit 9b86637
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
#include <vector>
#include <map>
#include <string>

#include "relic_conf.h"

#if defined GMP && ARITH == GMP
#include <gmp.h>
#endif

#include "blspublickey.hpp"
#include "blsprivatekey.hpp"
#include "blssignature.hpp"
Expand Down
6 changes: 6 additions & 0 deletions src/blsprivatekey.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
#ifndef SRC_BLSPRIVATEKEY_HPP_
#define SRC_BLSPRIVATEKEY_HPP_

#include "relic_conf.h"

#if defined GMP && ARITH == GMP
#include <gmp.h>
#endif

#include "blspublickey.hpp"
#include "blssignature.hpp"

Expand Down
6 changes: 6 additions & 0 deletions src/blspublickey.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
#include <iostream>
#include <vector>

#include "relic_conf.h"

#if defined GMP && ARITH == GMP
#include <gmp.h>
#endif

#include "blsutil.hpp"

/** An encapsulated public key. */
Expand Down
6 changes: 6 additions & 0 deletions src/blssignature.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
#include <iostream>
#include <vector>

#include "relic_conf.h"

#if defined GMP && ARITH == GMP
#include <gmp.h>
#endif

#include "blsutil.hpp"
#include "aggregationinfo.hpp"

Expand Down
6 changes: 6 additions & 0 deletions src/blsutil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
#include <string>
#include <cstdlib>

#include "relic_conf.h"

#if defined GMP && ARITH == GMP
#include <gmp.h>
#endif

#if BLSALLOC == sodium
namespace libsodium {
#include "sodium/utils.h"
Expand Down
6 changes: 6 additions & 0 deletions src/chaincode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@

#include <iostream>

#include "relic_conf.h"

#if defined GMP && ARITH == GMP
#include <gmp.h>
#endif

namespace relic {
#include "relic.h"
#include "relic_test.h"
Expand Down
6 changes: 6 additions & 0 deletions src/extendedprivatekey.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
#ifndef SRC_EXTENDEDPRIVATEKEY_HPP_
#define SRC_EXTENDEDPRIVATEKEY_HPP_

#include "relic_conf.h"

#if defined GMP && ARITH == GMP
#include <gmp.h>
#endif

#include "blsprivatekey.hpp"
#include "blspublickey.hpp"
#include "chaincode.hpp"
Expand Down
6 changes: 6 additions & 0 deletions src/extendedpublickey.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
#ifndef SRC_EXTENDEDPUBLICKEY_HPP_
#define SRC_EXTENDEDPUBLICKEY_HPP_

#include "relic_conf.h"

#if defined GMP && ARITH == GMP
#include <gmp.h>
#endif

#include "blspublickey.hpp"
#include "chaincode.hpp"

Expand Down

0 comments on commit 9b86637

Please sign in to comment.