From 3657a0d9880f948f1435c96431b805797dd2c39b Mon Sep 17 00:00:00 2001 From: Daniel Demmler Date: Thu, 16 May 2019 14:08:53 +0200 Subject: [PATCH] changed thread parameter to threadid and removed unneeded ones --- src/abycore/aby/abysetup.cpp | 24 ++++++++++++------------ src/abycore/aby/abysetup.h | 16 ++++++++-------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/abycore/aby/abysetup.cpp b/src/abycore/aby/abysetup.cpp index 63a7f316..4ef85eb5 100644 --- a/src/abycore/aby/abysetup.cpp +++ b/src/abycore/aby/abysetup.cpp @@ -242,7 +242,7 @@ BOOL ABYSetup::FinishSetupPhase() { return true; } -BOOL ABYSetup::ThreadRunNPSnd(uint32_t exec) { +BOOL ABYSetup::ThreadRunNPSnd() { BOOL success = true; iknp_ot_sender->ComputeBaseOTs(P_FIELD); #ifdef USE_KK_OT @@ -251,7 +251,7 @@ BOOL ABYSetup::ThreadRunNPSnd(uint32_t exec) { return success; } -BOOL ABYSetup::ThreadRunNPRcv(uint32_t exec) { +BOOL ABYSetup::ThreadRunNPRcv() { BOOL success = true; iknp_ot_receiver->ComputeBaseOTs(P_FIELD); #ifdef USE_KK_OT @@ -261,10 +261,10 @@ BOOL ABYSetup::ThreadRunNPRcv(uint32_t exec) { } //Receiver and Sender switch roles in the beginning of the OT extension protocol to obliviously transfer a matrix T -BOOL ABYSetup::ThreadRunIKNPSnd(uint32_t exec) { +BOOL ABYSetup::ThreadRunIKNPSnd(uint32_t threadid) { bool success = true; - uint32_t inverse = exec ^ m_eRole; + uint32_t inverse = threadid ^ m_eRole; uint32_t nsndvals = 2; CBitVector** X = (CBitVector**) malloc(sizeof(CBitVector*) * nsndvals); @@ -295,10 +295,10 @@ BOOL ABYSetup::ThreadRunIKNPSnd(uint32_t exec) { return success; } -BOOL ABYSetup::ThreadRunIKNPRcv(uint32_t exec) { +BOOL ABYSetup::ThreadRunIKNPRcv(uint32_t threadid) { bool success = true; - uint32_t inverse = exec ^ m_eRole; + uint32_t inverse = threadid ^ m_eRole; // uint32_t symbits = m_cCrypt->get_seclvl().symbits; uint32_t nsndvals = 2; @@ -329,10 +329,10 @@ BOOL ABYSetup::ThreadRunIKNPRcv(uint32_t exec) { //KK13 OT extension sender and receiver routine outsourced in separate threads -BOOL ABYSetup::ThreadRunKKSnd(uint32_t exec) { +BOOL ABYSetup::ThreadRunKKSnd(uint32_t threadid) { bool success = true; - uint32_t inverse = exec ^ m_eRole; + uint32_t inverse = threadid ^ m_eRole; for (uint32_t i = 0; i < m_vKKOTTasks[inverse].size(); i++) { KK_OTTask* task = m_vKKOTTasks[inverse][i]; @@ -366,10 +366,10 @@ BOOL ABYSetup::ThreadRunKKSnd(uint32_t exec) { return success; } -BOOL ABYSetup::ThreadRunKKRcv(uint32_t exec) { +BOOL ABYSetup::ThreadRunKKRcv(uint32_t threadid) { bool success = true; - uint32_t inverse = exec ^ m_eRole; + uint32_t inverse = threadid ^ m_eRole; // uint32_t symbits = m_cCrypt->get_seclvl().symbits; // uint32_t nsndvals = 2; @@ -604,9 +604,9 @@ void ABYSetup::CWorkerThread::ThreadMain() { break; case e_NP: if (threadid == SERVER) - bSuccess = m_pCallback->ThreadRunNPSnd(threadid); + bSuccess = m_pCallback->ThreadRunNPSnd(); else - bSuccess = m_pCallback->ThreadRunNPRcv(threadid); + bSuccess = m_pCallback->ThreadRunNPRcv(); break; case e_MTPaillier: bSuccess = m_pCallback->ThreadRunPaillierMTGen(threadid); diff --git a/src/abycore/aby/abysetup.h b/src/abycore/aby/abysetup.h index 006e354b..3f3bf806 100644 --- a/src/abycore/aby/abysetup.h +++ b/src/abycore/aby/abysetup.h @@ -152,19 +152,19 @@ class ABYSetup { BOOL Init(); void Cleanup(); - BOOL ThreadRunNPSnd(uint32_t exec); - BOOL ThreadRunNPRcv(uint32_t exec); + BOOL ThreadRunNPSnd(); + BOOL ThreadRunNPRcv(); - BOOL ThreadRunIKNPSnd(uint32_t exec); - BOOL ThreadRunIKNPRcv(uint32_t exec); + BOOL ThreadRunIKNPSnd(uint32_t threadid); + BOOL ThreadRunIKNPRcv(uint32_t threadid); - BOOL ThreadRunKKSnd(uint32_t exec); - BOOL ThreadRunKKRcv(uint32_t exec); + BOOL ThreadRunKKSnd(uint32_t threadid); + BOOL ThreadRunKKRcv(uint32_t threadid); - BOOL ThreadSendData(uint32_t id); + BOOL ThreadSendData(uint32_t threadid); BOOL ThreadReceiveData(); - BOOL ThreadRunPaillierMTGen(uint32_t exec); + BOOL ThreadRunPaillierMTGen(uint32_t threadid); BOOL ThreadRunDGKMTGen(uint32_t threadid); // IKNP OTTask values