From 294e94256d6a208a2e06688908dd8c0e7081c8f9 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 7 Mar 2017 10:00:52 +0100 Subject: [PATCH] More stable compilation for glib2.0, replaced name for hash routine by psi_hashing_function to avoid redifinition by external projects --- Makefile | 4 ++-- src/naive-hashing/naive-psi.cpp | 2 +- src/pk-based/dh-psi.cpp | 4 ++-- src/server-aided/sapsi.cpp | 2 +- src/util/helpers.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index f001649..157ca10 100644 --- a/Makefile +++ b/Makefile @@ -22,10 +22,10 @@ MIRACL_MAKE:=linux GNU_LIB_PATH:=i386 endif -INCLUDE=-I.. -I/usr/include/glib-2.0/ -I/usr/lib/${GNU_LIB_PATH}-linux-gnu/glib-2.0/include +INCLUDE=-I.. -I/usr/include/glib-2.0/ -I/usr/lib/${GNU_LIB_PATH}-linux-gnu/glib-2.0/include `pkg-config --cflags glib-2.0` -LIBRARIES=-lgmp -lgmpxx -lpthread -L /usr/lib -lssl -lcrypto -lglib-2.0 +LIBRARIES=-lgmp -lgmpxx -lpthread -L /usr/lib -lssl -lcrypto -lglib-2.0 `pkg-config --libs glib-2.0` CFLAGS= # all source files and corresponding object files diff --git a/src/naive-hashing/naive-psi.cpp b/src/naive-hashing/naive-psi.cpp index b53c5a1..f400d74 100644 --- a/src/naive-hashing/naive-psi.cpp +++ b/src/naive-hashing/naive-psi.cpp @@ -75,7 +75,7 @@ uint32_t naivepsi(role_type role, uint32_t neles, uint32_t pneles, task_ctx ectx ectx.eles.perm = perm; ectx.sctx.symcrypt = crypt_env; - run_task(ntasks, ectx, hash); + run_task(ntasks, ectx, psi_hashing_function); phashes = (uint8_t*) malloc(sizeof(uint8_t) * pneles * maskbytelen); diff --git a/src/pk-based/dh-psi.cpp b/src/pk-based/dh-psi.cpp index fb37446..b99fa96 100644 --- a/src/pk-based/dh-psi.cpp +++ b/src/pk-based/dh-psi.cpp @@ -77,7 +77,7 @@ uint32_t dhpsi(role_type role, uint32_t neles, uint32_t pneles, task_ctx ectx, c #ifdef DEBUG cout << "Hashing elements" << endl; #endif - run_task(ntasks, ectx, hash); + run_task(ntasks, ectx, psi_hashing_function); /* Encrypt elements */ ectx.eles.input1d = hashes; @@ -141,7 +141,7 @@ uint32_t dhpsi(role_type role, uint32_t neles, uint32_t pneles, task_ctx ectx, c #ifdef DEBUG cout << "Hashing elements" << endl; #endif - run_task(ntasks, ectx, hash); + run_task(ntasks, ectx, psi_hashing_function); #ifdef DEBUG cout << "Exchanging hashes" << endl; diff --git a/src/server-aided/sapsi.cpp b/src/server-aided/sapsi.cpp index c9306a3..7a4661d 100644 --- a/src/server-aided/sapsi.cpp +++ b/src/server-aided/sapsi.cpp @@ -203,7 +203,7 @@ uint32_t client_routine(uint32_t neles, task_ctx ectx, uint32_t* matches, ectx.sctx.symcrypt = crypt_env; ectx.sctx.keydata = (uint8_t*) const_seed; - run_task(ntasks, ectx, hash); + run_task(ntasks, ectx, psi_hashing_function); socket->Send(masks, maskbytelen * neles); diff --git a/src/util/helpers.h b/src/util/helpers.h index ab5b0f6..db80021 100644 --- a/src/util/helpers.h +++ b/src/util/helpers.h @@ -181,7 +181,7 @@ static void *sym_encrypt(void* context) { return 0; } -static void *hash(void* context) { +static void *psi_hashing_function(void* context) { #ifdef DEBUG cout << "Hashing thread started" << endl; #endif