Skip to content

Commit

Permalink
changed thread parameter to threadid and removed unneeded ones
Browse files Browse the repository at this point in the history
  • Loading branch information
dd23 committed May 16, 2019
1 parent 423565a commit 3657a0d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
24 changes: 12 additions & 12 deletions src/abycore/aby/abysetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down
16 changes: 8 additions & 8 deletions src/abycore/aby/abysetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3657a0d

Please sign in to comment.