Giter VIP home page Giter VIP logo

aby3's People

Contributors

fannxy avatar gutjuri avatar ladnir avatar ladnir2 avatar marsella avatar rindalvisa avatar rosulek avatar warumdk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aby3's Issues

circuitInputShare's content are not from cuckooTable

A = [1,2,3,4,5,6] B = [1,2,3,10,11,12] do DB_Intersection
After revealing the cuckooTable and circuitInputShare table found:

cuckooTable was right:
cucktable[11] = 0a000000000000000a00241e97865ed3b56c64e6a8e9d682c30019dc8880ad289a74
cucktable[12] = 01000000000000000100297937b4b86ca021327c02488fa0df20bbafef6f33556e86
ccuktable[18] = 0c000000000000000c00186fc64c5c5681abfc6b7bd62111722317ac91052710215c
cucktable[20] = 03000000000000000300677c7b5348bdede1a8cac793598768fec6481f67eccf8a18
cucktable[23] = 02000000000000000200d0ff93f69f0aef062dc171f7f94ee6677b42301fa9e48cca
cucktable[24] = 0b000000000000000b00ef8912f6ede93b3d5772bbaa9683a39b62d9c6eeb2a5d6a8

But hash table was wrong: only one line in hash0 could match the data of cuckootable. This is a bug, you could reproduce in the latest version easily

hash0 = 01000000000000000100297937b4b86ca021327c02488fa0df20bbafef6f33556e86
hash0 = 5ec72263a4b84a31fd447fc2792ab70f2bd6864cd270530518387a637d08ef35ab7b
hash0 = b72863843fa22c17f48f84380ff92a09b8951ce58e07862edea2e7603c9f2cad2d4a
hash0 = 030000005b366cb37eb581a652d4b32a38103c6e84c4ae7cb30e24bd525e8bcb3eeb
hash0 = daa841e0643a427095af276396941f308b9b5d585396fa096e22c36bb1039754a4de
hash0 = 13decd5f80a00cdbde86f8c332c0fe7e58f3b51c96afb10c93eee012c85ac53d081a

hash1 = 13decd5f80a00cdbde86f8c332c0fe7e58f3b51c96afb10c93eee012c85ac53d081a
hash1 = 00000000000000000000000000000000000000000000000000000000000000000000
hash1 = 5cc72263a4b84a31ff44af3deadc2805c4d0ab8da387aa4bfe5f01214d1746d127b1
hash1 = c9768cbfe49a4eab4b29dfa0a454e14ed368e844c5394b05fdcc237979595269acc4
hash1 = 000000005b366cb37db5e6da2987fb97d5f194a44357f7fbdbf0e2f54d396704b4f3
hash1 = b4286384649440a48a3a059e5d2d99238085208b0ac328526dacc3dd6ec1a76613a1

hash2 = b4286384649440a48a3a059e5d2d99238085208b0ac328526dacc3dd6ec1a76613a1
hash2 = 000000005b366cb37db5e6da2987fb97d5f194a44357f7fbdbf0e2f54d396704b4f3
hash2 = 5cc72263a4b84a31ff44af3deadc2805c4d0ab8da387aa4bfe5f01214d1746d127b1
hash2 = c9768cbfe49a4eab4b29dfa0a454e14ed368e844c5394b05fdcc237979595269acc4
hash2 = 13decd5f80a00cdbde86f8c332c0fe7e58f3b51c96afb10c93eee012c85ac53d081a
hash2 = 00000000000000000000000000000000000000000000000000000000000000000000

There is a problem during installing.

I have a problem during compiling aby3 in Linux. The errors include:

/workspace/aby3/aby3/Circuit/Garble.cpp: In static member function 'static osuCrypto::block osuCrypto::Garble::garbleConstGate(bool, bool, const std::array<osuCrypto::block, 2>&, const osuCrypto::GateType&, const osuCrypto::block&)':
/workspace/aby3/aby3/Circuit/Garble.cpp:70:91: error: no match for 'operator^' (operand types are '__m128i' {aka '__vector(2) long long int'} and 'osuCrypto::block')
   70 |    return _mm_or_si128(Garble::mPublicLabels[v / 3], (in[constA] & zeroAndAllOne[v > 0])) ^ (zeroAndAllOne[v == 1] & xorOffset);
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                       |                                                                                            |
      |                       __m128i {aka __vector(2) long long int}                                                      osuCrypto::block
compilation terminated due to -Wfatal-errors.
aby3/CMakeFiles/aby3.dir/build.make:75: recipe for target 'aby3/CMakeFiles/aby3.dir/Circuit/Garble.cpp.o' failed

It seems that operator ^ is used between different types, and I don't know how to solve it.

Thank you!

libOTe/cryptoTools needs to have ENABLE_CIRCUITS defined.

I follow instructions in the readme to build the project. However, when I run cmake . in aby3 directory, the following error occurred

CMake Error at CMakeLists.txt:65 (message):
  libOTe/cryptoTools needs to have ENABLE_CIRCUITS defined.

I have run cmake . -DENABLE_CIRCUITS=ON in the libOTe , but the CMake script in aby3 directory cannot find the environment variable.

libOTe/cryptoTools/cryptoToolsConfig.cmake has already set(ENABLE_CIRCUITS ON), but seems not be executed.

test 23 sometimes failed on Centos7

bin/frontend -u
0 - BtNetwork_SBO_ptr_test Passed 0ms
1 - BtNetwork_Connect1_Test Passed 0ms
2 - BtNetwork_RapidConnect_Test Passed 26ms
3 - BtNetwork_shutdown_test Passed 1ms
4 - BtNetwork_SocketInterface_Test Passed 5ms
5 - BtNetwork_OneMegabyteSend_Test Passed 3ms
6 - BtNetwork_ConnectMany_Test Passed 6ms
7 - BtNetwork_CrossConnect_Test Passed 0ms
8 - BtNetwork_ManySessions_Test Passed 6ms
9 - BtNetwork_bitVector_Test Passed 0ms
10 - BtNetwork_AsyncConnect_Test Passed 1ms
11 - BtNetwork_std_Containers_Test Passed 0ms
12 - BtNetwork_recvErrorHandler_Test Passed 0ms
13 - BtNetwork_closeOnError_Test Passed 0ms
14 - BtNetwork_AnonymousMode_Test Passed 0ms
15 - BtNetwork_CancelChannel_Test Passed 89ms
16 - BtNetwork_useAfterCancel_test Passed 1ms
17 - BtNetwork_fastCancel Passed 23ms
18 - BtNetwork_ServerMode_Test Passed 19ms
19 - BtNetwork_clientClose_Test Passed 31ms
20 - BtNetwork_BadConnect_Test Passed 0ms
21 - BtNetwork_oneWorker_Test Passed 0ms
22 - BtNetwork_queue_Test Passed 2ms
23 - BtNetwork_socketAdapter_test Segmentation fault

Malicious-secure implementation of ABY3?

Hi @ladnir! I'm working on an implementation for an upcoming paper and I've found that I essentially need to implement (a subset of) malicious-secure ABY3. Do you know if there are any malicious-secure implementations out there? I haven't been able to find any.

How to compute the time consumption for OFFLINE phase

Hey, when running the code i found a issue that the code to handle the pre-processing operation (OFFLINE phase) seems to be not implemented so far.
void preprocess(u64 n, Decimal d) { TODO("implement this"); }

The public code i think can only test the benchmark of online data and I wonder how to measure the online+offline data.

Confused about the comparison circuit in ABY3

Greetings

Currently, we want to implement greater-than function about two secret fixed-points (sf64) in ABY3, and the interfaces between secret ints and circuits raise some confusion.

In my understanding, the greater-than function should be organized as sbMatrix res = msb( si64 a.mShares - si64 b.mShares) in ABY3, where a and b are all sf64. The steps including:

  1. transfer the sf64 to corresponding si64 a.mShare and b.mShare;
  2. use the int_int_sub_msb_build_do circuit function to compute for the msb.

Here we at first think the int and int are corresponding si64 a and si64 b, while it seems we should put two i64 for the int_int_sub_msb_build_do circuit.

Could you please tell us how to implement such function ? we got confused to know which share should the corresponding party pass to the circuit.

Thanks a lot!

why use int_add_msb_build_do in int_Sh3Piecewise_build_do?

Hi, ladnir, i'm reading the code of Sh3Piecewise, a question puzzle me, when compute x < threshold, why use add_msb_build_do, rather not sub_msb_build_do?? i think, msb(x - threshold) should deal with sub_msb. what's the logitic here? Thanks. the code is in CircuitLibrary.cpp, line 100.

Working with fixed point type

I'm trying to work with shares that are floats/doubles as it seemed most appropriate.

I declared a variable fixedInt of type f64 as follows:

f64<D8> fixedInt = 34.124

When I print the value of this variable using std::cout, I get

34.12109375

It's not even a rounding error. I don't quite understand why the value printed is so far from intended.

Also, is f64<D8> fixedInt = 2/double(3) the right way to store 0.6666667 in fixedInt? When I print fixedInt after doing this, it prints 0.6640625 (Similar issue as above)

boost error

following the Linux installation notes on Ubuntu 20.04 fails on the next to last line (cmake .) with the following error message:

CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find Boost: missing: system thread (found /home/user/boost/lib/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0"))
CMake Error at aby3/CMakeLists.txt:19 (message):
  Failed to find boost at Need system thread


-- Configuring incomplete, errors occurred!
See also "/home/user/Projects/ABY3/aby3/CMakeFiles/CMakeOutput.log".

what the logic of matrix multiplication is in aby3?

Hi, I tried the matrix operation demo in frontend/aby3Tutorial.cpp where the matrix is with 10 rows and 4 columns.

I noticed that the multiplication got two matrix of 10X4 as input and output it to another place with the same shape.

I think we can do 10X4 multiplies 4X10 to get a 10X10 or do 4X10 multiplies 10X4 to get a 4X4, but if we do 10X4 * 10 X4 we should receive an error in Eigen, right? I'm just wondering what happened in the matrix multiplication in the tutorial codes.

Thank you

ERROR: Could NOT find libOTe (missing: libOTe_DIR)

[root@ac6 aby3]# python3 build.py 
======= build.py (aby3) ==========
mkdir -p out/build/linux
cmake -S . -B out/build/linux  -DCMAKE_BUILD_TYPE=Release
cmake --build out/build/linux   
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

-- The CXX compiler identification is GNU 8.5.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find libOTe (missing: libOTe_DIR)
CMake Error at CMakeLists.txt:68 (message):
  libOTe/cryptoTools needs to have boost enabled.


-- Configuring incomplete, errors occurred!
See also "/root/aby3/out/build/linux/CMakeFiles/CMakeOutput.log".
See also "/root/aby3/out/build/linux/CMakeFiles/CMakeError.log".
gmake: Makefile: No such file or directory
gmake: *** No rule to make target 'Makefile'.  Stop.

Does anyone encounter such kind problem?

Possible bugs of logistic statistics?

Suppose a batch of 10000 rows*100cols, each 64 bits, which is 8MBใ€‚
So it's 16MB at least for Replicated SS.

But the statistics is : N: 10000 D:100 B:10000 IT:1000 => 24.4529 iters/s 125.969 Mbps
So there might be some bugs in the statistics?

Bad address Error

Dear ladnir,

I hope this message finds you well. I have encountered an intermittent issue while running the program. This problem happens during multiple iterations, particularly during the evaluation of greater-than circuits, I occasionally receive the following error:

network send error: Bad address
at /root/aby3/thirdparty/libOTe/cryptoTools/cryptoTools/Network/Channel.cpp:871

This error seems to occur randomly and does not have a specific pattern. I have noticed it happening more frequently during circuit evaluations involving greater-than operations.

I would like to seek your guidance on how to address this issue. Are you aware of this problem, and do you have any suggestions or insights on how to avoid or mitigate it?

Any assistance or advice you can provide to help me resolve this issue would be greatly appreciated. I understand that you and the contributors may have limited time, and I am grateful for any attention you can give to this matter.

Best regards,
Fannxy

Some problematic results of ``int_eq`` circuit.

Greetings, we found some problematic outputs when implementing equal test using int_eq circuit (defined in cryptoTools).

When we implementing the equal test for two si64 matrices, the result are always 0 whether for equal or unequal elements.

For example, we define si64Matrix isharedA and isharedB as following:

i64Matrix iplainA(rows, cols);
i64Matrix iplainB(rows, cols);

for(u64 j=0; j<rows; j++){
	for (u64 i = 0; i<cols; i++){
	  iplainA(j, i) = j;
	  iones(j, i) = 1;
	  // iplainB(j, i) = j;
	  if (j%2 == 0) iplainB(j, i) = j + 1;
	  else iplainB(j, i) = j;
	}
} 

// the following code is executed by each party (pIdx)
si64Matrix isharedA(iplainA.rows(), iplainA.cols());
si64Matrix isharedB(iplainB.rows(), iplainB.cols());

if(pIdx == 0){
	enc.localIntMatrix(runtime, iplainA, isharedA).get();
	enc.localIntMatrix(runtime, iplainB, isharedB).get();
}
else{
	enc.remoteIntMatrix(runtime, isharedA).get();
	enc.remoteIntMatrix(runtime, isharedB).get();
}

where isharedA = [0, 1, 2, 3, 4, 5 ..., nrows] and isharedB = [1, 1, 3, 3, 5, 5 ... ], all the odd indexed elements are equal with isharedA.
Then we implement the equal test for isharedA and isharedB as following:

// defined for each party (pIdx).
Sh3BinaryEvaluator binEng;
CircuitLibrary lib;
sbMatrix circuitInput0;
sbMatrix circuitInput1;
sbMatrix res;

circuitInput0.resize(isharedA.size(), 64);
circuitInput1.resize(isharedB.size(), 64);

// generate the corresponding binary inputs.
memcpy(circuitInput0.mShares[0].data(), isharedA.mShares[0].data(), isharedA.size() * sizeof(i64));
memcpy(circuitInput0.mShares[1].data(), isharedA.mShares[1].data(), isharedA.size() * sizeof(i64));
memcpy(circuitInput1.mShares[0].data(), isharedB.mShares[0].data(), isharedB.size() * sizeof(i64));
memcpy(circuitInput1.mShares[1].data(), isharedB.mShares[1].data(), isharedB.size() * sizeof(i64));

// define the eq test circuit and execute
auto cir = lib.int_eq(sizeof(i64)*8);
binEng.setCir(cir, intA.size(), eval.mShareGen);
binEng.setInput(0, circuitInput0);
binEng.setInput(1, circuitInput1);
binEng.asyncEvaluate(runtime).then([&](Sh3Task self) {
  res.resize(intA.size(), 1);
  binEng.getOutput(0, res);
}).get();

we expect the result in res should be [0, 1, 0, 1, 0, 1, ...] the eq result should be one 0 and then one 1, but the result are all 0.

Is the use of int_eq circuit right? or there indeed exist some problem...

ps, the result of int_neq is all 1.

Thanks for your help.

Does intersect implement in aby3 support bit count of key larger than 80?

Hello, I want to use aby3's intersect implement as a PSI implement, and I find that bit count of key is fixed to 80 but 256 in our project, so can aby3 support intersect with bit count of key larger than 80? And the source code of intersect is too hard too understand, can you provide me a more detailed documents such as a paper ?

Compile standalone codes

How do we compile standalone codes, using which command?? In case I want to make some changes or write my own sample code, what is the best approach and how do I compile and run ?

problem arising when I build and the corresponding solution

Behavior 1

When "python3 build.py --setup", it reports an error to me that the commond "ARCHIVE_EXTRACT" can not be recognized by cmake. The version of my cmake is v3.16

Possible Solution 1

"ARCHIVE_EXTRACT" is a commond of cmake v3.18, so the version of cmake should be v3.18 instead of the 3.15 in CMakeLists.txt

Behavior 2

When "python3 build.py", it reports an error to me that "libOTe/cryptoTools needs to have ENABLE_CIRCUITS defined".

Possible Solution 2

the code " -- -DENABLE_CIRCUITS=ON " in the 51th row of getLibOTe.py should be changed to " -DENABLE_CIRCUITS=ON "

CMake Error at CMakeLists.txt:72 (message): libOTe/cryptoTools needs to have ENABLE_CIRCUITS defined.

When I run "python3 build.py", I get the error below. I found that this question has been raised๏ผŒbut i still dont know how to fix it ,Can you tell me exactly how to do, Thanks!!

python3 build.py
======= build.py (aby3) ==========
mkdir -p out/build/linux
cmake -S . -B out/build/linux -DCMAKE_BUILD_TYPE=Release
cmake --build out/build/linux --parallel 32
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost: /root/zjh_workplace/aby3/thirdparty/unix/lib/cmake/Boost-1.75.0/BoostConfig.cmake (found suitable version "1.75.0", minimum required is "1.75") found components: system thread
-- Boost_LIB: Boost::system;Boost::thread
-- Boost_INC: /root/zjh_workplace/aby3/thirdparty/unix/include

CMake Error at CMakeLists.txt:72 (message):
libOTe/cryptoTools needs to have ENABLE_CIRCUITS defined.

-- Configuring incomplete, errors occurred!
See also "/root/zjh_workplace/aby3/out/build/linux/CMakeFiles/CMakeOutput.log".
make: Makefile: No such file or directory
make: *** No rule to make target 'Makefile'. Stop.

libOTe/cryptotools needs to have ENABLE_CIRCUITS defined.

When I run "python3 build.py", I get the error below.

Cmake Error at CMakeLists.txt: 72(message):
libOTe/cryptotools needs to have ENABLE_CIRCUITS defined

This error occurs in both Windows and Ubuntu, but when I tried to change the latest updade back(I mean change line 51 from "-DENABLE_CIRCUITS" back to "-- -DENABLE_CIRCUITS" in the file thirdparty/getLibOTe.py), the Error disappeared and the process of build succeed.

I'm wondering why to make this update(from "-- -D" to "-D") and whether it is necessary? Thank you very much!

python3 build.py error

when I run python3 build.py, I have the error

CMake Error at out/build/linux/cryptoTools/cmake_install.cmake:69 (file):
file INSTALL cannot find
"/home/shenpeilin/aby3/thirdparty/libOTe/out/build/linux/cryptoTools/cryptoTools/libcryptoTools.a":
No such file or directory.
Call Stack (most recent call first):
out/build/linux/cmake_install.cmake:47 (include)

I have try to install all of depend packages like boost cmake etc

client socket connect error

Hello. When I try to run the test, it return the following problem.

> ./bin/frontend -u
  0 - BtNetwork_SBO_ptr_test                    Passed   0ms
  1 - BtNetwork_Connect1_Test                 Permission denied
client socket connect error (hangs).

I retry with sudo, but the same problem still exists.

What should I do? Thank you.

how to convert sbMatrix to si64Matrix?

Hello,

Can a matrix with the type of sbMatrix add each row and get a result? Seems the following code can't work.

auto select = std::vector<SharedTable::ColRef>{ B["key"], B["b1"], B["b2"], A["key"], A["a1"], A["a2"]};
auto C = srvs[i].leftJoin(A["key"], B["key"], select, "registed");

aby3::sbMatrix& b1Col = C.mColumns[1];
aby3::sbMatrix b1Sum(b1Col.rows(), b1Col.i64Cols());
b1Sum.mShares[0].setZero();
b1Sum.mShares[1].setZero();

// b1Sum add each row
for (u64 j = 0; j < b1Col.rows(); ++j) {
		b1Sum.mShares[0](0) += b1Col.mShares[0](j);
		b1Sum.mShares[0](1) += b1Col.mShares[1](j);
}

I find si64Matrix could do the plus and mul operation. So how can I convert sbMatrix to si64Matrix? Thanks.

Using SIMD and Multithreading

Does ABY have SIMD or Multithreading support? If so, how can I evaluate multiple inependent multiplications like in this example more efficiently? Also, what's the API for AND gates instead of Multiplication gates?

si64 prod = sharedVec[0];
task = runtime.noDependencies();
for (u64 i = 1; i < sharedVec.size(); ++i)
task = eval.asyncMul(task, prod, sharedVec[i], prod);

task.get();

Questions about cmake

Hello, I'm executing
python3 build. py --setup
The following error is reported during this command:
ee585da3c2182570f7a765e89bd37c2
While executing
python3 build. py
The following errors are reported:
3bd3a4180598d1350a8dd808540ba19
Why is this problem? Please help me!

Some tests failed on Linux

Ubuntu 18.04 64 bit

./bin/frontend.exe -u

0 - BtNetwork_Connect1_Test Passed 1ms
1 - BtNetwork_RapidConnect_Test Passed 56ms
2 - BtNetwork_SocketInterface_Test Passed 9ms
3 - BtNetwork_OneMegabyteSend_Test Passed 4ms
4 - BtNetwork_ConnectMany_Test Passed 11ms
5 - BtNetwork_CrossConnect_Test Passed 1ms
6 - BtNetwork_ManySessions_Test Passed 9ms
7 - BtNetwork_bitVector_Test Passed 1ms
8 - BtNetwork_AsyncConnect_Test Passed 3ms
9 - BtNetwork_std_Containers_Test Passed 1ms
10 - BtNetwork_recvErrorHandler_Test Passed 1ms
11 - BtNetwork_closeOnError_Test Passed 2ms
12 - BtNetwork_AnonymousMode_Test Passed 2ms
13 - BtNetwork_CancelChannel_Test Passed 121ms
14 - BtNetwork_useAfterCancel_test Passed 3ms
15 - BtNetwork_fastCancel Passed 28ms
16 - BtNetwork_ServerMode_Test Passed 39ms
17 - BtNetwork_clientClose_Test Passed 56ms
18 - BtNetwork_BadConnect_Test Passed 1ms
19 - BtNetwork_oneWorker_Test Passed 0ms
20 - BtNetwork_queue_Test Passed 2ms
21 - wolfSSL_echoServer_test Skipped - ENABLE_WOLFSSL not defined 0ms
22 - wolfSSL_mutualAuth_test Skipped - ENABLE_WOLFSSL not defined 0ms
23 - wolfSSL_channel_test Skipped - ENABLE_WOLFSSL not defined 0ms
24 - wolfSSL_CancelChannel_Test Skipped - ENABLE_WOLFSSL not defined 0ms
25 - AES Passed 73ms
26 - BitVector_Indexing_Test Passed 0ms
27 - BitVector_Parity Passed 2ms
28 - BitVector_Append_Test Passed 0ms
29 - BitVector_Copy_Test Passed 0ms
30 - BitVector_Resize_Test Passed 0ms
31 - Ecc2mNumber_Test Skipped - ENABLE_MIRACL not defined. 0ms
32 - Ecc2mPoint_Test Skipped - ENABLE_MIRACL not defined. 0ms
33 - EccpNumber_Test Skipped - ENABLE_MIRACL not defined. 0ms
34 - EccpPoint_Test Skipped - ENABLE_MIRACL not defined. 0ms
35 - REccpNumber_Test Skipped - ENABLE_RELIC not defined. 0ms
36 - REccpPoint_Test Skipped - ENABLE_RELIC not defined. 0ms
37 - SBO_ptr_test Passed 0ms
38 - BetaCircuit_SequentialOp_Test Passed 0ms
39 - BetaCircuit_int_Adder_Test Passed 13ms
40 - BetaCircuit_int_Adder_const_Test Passed 4ms
41 - BetaCircuit_int_Subtractor_Test Passed 4ms
42 - BetaCircuit_int_Subtractor_const_Test Passed 4ms
43 - BetaCircuit_uint_Adder_Test Passed 4ms
44 - BetaCircuit_uint_Subtractor_Test Passed 4ms
45 - BetaCircuit_int_Multiply_Test Passed 0ms
46 - BetaCircuit_uint_Multiply_Test Passed 0ms
47 - BetaCircuit_int_Divide_Test Passed 5ms
48 - BetaCircuit_int_LessThan_Test Passed 0ms
49 - BetaCircuit_int_GreaterThanEq_Test Passed 0ms
50 - BetaCircuit_uint_LessThan_Test Passed 0ms
51 - BetaCircuit_uint_GreaterThanEq_Test Passed 0ms
52 - BetaCircuit_multiplex_Test Passed 0ms
53 - BetaCircuit_negate_Test Passed 0ms
54 - BetaCircuit_bitInvert_Test Passed 0ms
55 - BetaCircuit_removeSign_Test Passed 0ms
56 - BetaCircuit_addSign_Test Passed 0ms
57 - BetaCircuit_json_Tests Skipped - USE_JSON not defined. 0ms
58 - BetaCircuit_bin_Tests Passed 4ms
59 - BetaCircuit_aes_test
Passed 4ms
60 - BetaCircuit_int_Sh3Piecewise_Test Passed 2ms
61 - Sh3_Runtime_schedule_test Passed 0ms
62 - Sh3_trim_test Passed 5ms
63 - Sh3_Encryptor_IO_test Passed 8ms
64 - Sh3_Encryptor_asyncIO_test Passed 3ms
65 - Sh3_Evaluator_mul_test Failed - known issue. /root/aby3/aby3_tests/Sh3EvaluatorTests.cpp:515 0ms
66 - Sh3_Evaluator_asyncMul_test Passed 26ms
67 - Sh3_Evaluator_truncationPai_test Passed 1ms
68 - Sh3_Evaluator_asyncMul_fixed_test Passed 2ms
69 - Sh3_Evaluator_asyncMul_matrixFixed_test Passed 5ms
70 - SharedOT_eval_test Passed 3ms
71 - sh3_asyncArithBinMul_test Passed 6ms
72 - sh3_asyncPubArithBinMul_test Passed 2ms
73 - Sh3_f64_basics_test Passed 0ms
74 - Sh3_BinaryEngine_and_test Passed 285ms
75 - Sh3_BinaryEngine_add_test mode: 2 failed at 1 251 != 219
mode: 2 failed at 2 43 != 11
mode: 2 failed at 3 227 != 195
mode: 2 failed at 4 123 != 91
mode: 2 failed at 5 149 != 181
mode: 2 failed at 7 86 != 118
mode: 2 failed at 10 73 != 105
mode: 2 failed at 11 145 != 177
mode: 2 failed at 13 106 != 74
mode: 2 failed at 15 47 != 15
mode: 2 failed at 18 22 != 54
mode: 2 failed at 22 30 != 62
mode: 2 failed at 23 223 != 255
mode: 2 failed at 24 189 != 157
mode: 2 failed at 25 88 != 120
mode: 2 failed at 26 115 != 83
mode: 2 failed at 27 220 != 252
mode: 2 failed at 29 205 != 237
mode: 2 failed at 30 130 != 162
mode: 2 failed at 31 132 != 164
mode: 2 failed at 38 40 != 8
mode: 2 failed at 39 76 != 108
mode: 2 failed at 43 118 != 86
mode: 2 failed at 44 236 != 204
mode: 2 failed at 45 252 != 220
mode: 2 failed at 47 94 != 126
mode: 2 failed at 50 196 != 228
mode: 2 failed at 51 248 != 216
mode: 2 failed at 56 81 != 113
mode: 2 failed at 57 64 != 96
mode: 2 failed at 58 211 != 243
mode: 2 failed at 62 91 != 123
mode: 2 failed at 63 98 != 66
mode: 2 failed at 64 190 != 158
mode: 2 failed at 65 4 != 36
mode: 2 failed at 66 26 != 58
mode: 2 failed at 71 204 != 236
mode: 2 failed at 72 68 != 100
mode: 2 failed at 73 215 != 247
mode: 2 failed at 77 96 != 64
mode: 2 failed at 79 239 != 207
mode: 2 failed at 80 178 != 146
mode: 2 failed at 84 248 != 216
mode: 2 failed at 86 128 != 160
mode: 2 failed at 88 15 != 47
mode: 2 failed at 89 41 != 9
mode: 2 failed at 91 7 != 39
mode: 2 failed at 93 19 != 51
mode: 2 failed at 94 27 != 59
mode: 2 failed at 95 173 != 141
mode: 2 failed at 102 227 != 195
mode: 2 failed at 103 22 != 54
mode: 2 failed at 104 84 != 116
mode: 2 failed at 107 25 != 57
mode: 2 failed at 110 63 != 31
mode: 2 failed at 115 211 != 243
mode: 2 failed at 116 202 != 234
mode: 2 failed at 119 106 != 74
mode: 2 failed at 120 198 != 230
mode: 2 failed at 122 21 != 53
mode: 2 failed at 124 138 != 170
mode: 2 failed at 125 175 != 143
Failed - /root/aby3/aby3_tests/Sh3BinaryEvaluatorTests.cpp:284 292ms
76 - Sh3_BinaryEngine_add_msb_test; Passed 282ms
77 - Sh3_convert_b64Matrix_PackedBin_test Passed 3ms
78 - Sh3_Piecewise_plain_test Passed 0ms
79 - Sh3_Piecewise_test Passed 16ms
80 - lowMC_Circuit_test Passed 32ms
81 - lowMC_FileCircuit_test Skipped - USE_JSON not defined 0ms
82 - lowMC_BinFileCircuit_test Passed 15ms
83 - DB_computeKeys_test Passed 13ms
84 - Perm3p_overwrite_Test Passed 12ms
85 - Perm3p_additive_Test Passed 1ms
86 - Perm3p_subset_Test Passed 1ms
87 - switch_select_test Passed 22ms
88 - switch_duplicate_test Passed 42ms
89 - switch_full_test Passed 85ms
90 - DB_cuckooHash_test Passed 7ms
91 - DB_compare_test Passed 15ms
92 - DB_Intersect_test Passed 32ms
93 - DB_Intersect_sl_test Passed 22ms
94 - DB_Intersect_ls_test Passed 26ms
95 - DB_leftUnion_test Passed 18ms

#############################################
Failed (2)
Passed (82)
skipped (12)
#############################################

test 94 sometimes failed on ubuntu

simba@ubuntu:~/aby3$ bin/frontend -u
0 - BtNetwork_SBO_ptr_test Passed 0ms
1 - BtNetwork_Connect1_Test Passed 2ms
2 - BtNetwork_RapidConnect_Test Passed 69ms
3 - BtNetwork_shutdown_test Passed 2ms
4 - BtNetwork_SocketInterface_Test Passed 12ms
5 - BtNetwork_OneMegabyteSend_Test Passed 3ms
6 - BtNetwork_ConnectMany_Test Passed 12ms
7 - BtNetwork_CrossConnect_Test Passed 2ms
8 - BtNetwork_ManySessions_Test Passed 20ms
9 - BtNetwork_bitVector_Test Passed 0ms
10 - BtNetwork_AsyncConnect_Test Passed 5ms
11 - BtNetwork_std_Containers_Test Passed 0ms
12 - BtNetwork_recvErrorHandler_Test Passed 1ms
13 - BtNetwork_closeOnError_Test Passed 1ms
14 - BtNetwork_AnonymousMode_Test Passed 0ms
15 - BtNetwork_CancelChannel_Test Passed 142ms
16 - BtNetwork_useAfterCancel_test Passed 6ms
17 - BtNetwork_fastCancel Passed 24ms
18 - BtNetwork_ServerMode_Test Passed 31ms
19 - BtNetwork_clientClose_Test Passed 43ms
20 - BtNetwork_BadConnect_Test Passed 0ms
21 - BtNetwork_oneWorker_Test Passed 1ms
22 - BtNetwork_queue_Test Passed 1ms
23 - BtNetwork_socketAdapter_test Passed 2ms
24 - BtNetwork_BasicSocket_test Passed 1ms
25 - wolfSSL_echoServer_test Skipped - ENABLE_WOLFSSL not defined 0ms
26 - wolfSSL_mutualAuth_test Skipped - ENABLE_WOLFSSL not defined 0ms
27 - wolfSSL_channel_test Skipped - ENABLE_WOLFSSL not defined 0ms
28 - wolfSSL_CancelChannel_Test Skipped - ENABLE_WOLFSSL not defined 0ms
29 - block_operation_test Passed 0ms
30 - AES Passed 0ms
31 - Rijndael256 Passed 0ms
32 - BitVector_Indexing_Test Passed 0ms
33 - BitVector_Parity Passed 2ms
34 - BitVector_Append_Test Passed 0ms
35 - BitVector_Copy_Test Passed 0ms
36 - BitVector_Resize_Test Passed 0ms
37 - CuckooIndex_many_Test Passed 15ms
38 - CuckooIndex_paramSweep_Test Passed 67ms
39 - CuckooIndex_parallel_Test Passed 0ms
40 - Ecc2mNumber_Test Skipped - ENABLE_MIRACL not defined. 0ms
41 - Ecc2mPoint_Test Skipped - ENABLE_MIRACL not defined. 0ms
42 - EccpNumber_Test Skipped - ENABLE_MIRACL not defined. 0ms
43 - EccpPoint_Test Skipped - ENABLE_MIRACL not defined. 0ms
44 - REccpNumber_Test Skipped - ENABLE_RELIC not defined. 0ms
45 - REccpPoint_Test Skipped - ENABLE_RELIC not defined. 0ms
46 - BetaCircuit_SequentialOp_Test Passed 0ms
47 - BetaCircuit_int_Adder_Test Passed 0ms
48 - BetaCircuit_int_Adder_const_Test Passed 2ms
49 - BetaCircuit_int_Subtractor_Test Passed 10ms
50 - BetaCircuit_int_Subtractor_const_Test Passed 4ms
51 - BetaCircuit_uint_Adder_Test Passed 4ms
52 - BetaCircuit_uint_Subtractor_Test Passed 3ms
53 - BetaCircuit_int_Multiply_Test Passed 0ms
54 - BetaCircuit_uint_Multiply_Test Passed 1ms
55 - BetaCircuit_int_Divide_Test Passed 3ms
56 - BetaCircuit_int_LessThan_Test Passed 0ms
57 - BetaCircuit_int_GreaterThanEq_Test Passed 0ms
58 - BetaCircuit_uint_LessThan_Test Passed 1ms
59 - BetaCircuit_uint_GreaterThanEq_Test Passed 1ms
60 - BetaCircuit_multiplex_Test Passed 0ms
61 - BetaCircuit_negate_Test Passed 0ms
62 - BetaCircuit_bitInvert_Test Passed 0ms
63 - BetaCircuit_removeSign_Test Passed 0ms
64 - BetaCircuit_addSign_Test Passed 0ms
65 - BetaCircuit_json_Tests Skipped - USE_JSON not defined. 0ms
66 - BetaCircuit_bin_Tests Passed 3ms
67 - BetaCircuit_xor_and_lvl_test Passed 0ms
68 - BetaCircuit_aes_test Passed 3ms
69 - BetaCircuit_int_Sh3Piecewise_Test Passed 1ms
70 - garble_Test d30f8ef52bbfbb59f06f1de916187147
Passed 0ms
071 - Task_schedule_test Passed 0ms
072 - Sh3_Runtime_schedule_test Passed 0ms
073 - Sh3_Runtime_repeatInput_test Passed 0ms
074 - Sh3_trim_test Passed 3ms
075 - Sh3_Encryptor_IO_test Passed 10ms
076 - Sh3_Encryptor_asyncIO_test Passed 2ms
077 - Sh3_Evaluator_mul_test Passed 7ms
078 - Sh3_Evaluator_asyncMul_test Passed 20ms
079 - Sh3_Evaluator_truncationPai_test Passed 2ms
080 - Sh3_Evaluator_asyncMul_fixed_test Passed 1ms
081 - Sh3_Evaluator_asyncMul_matrixFixed_test Passed 13ms
082 - SharedOT_eval_test Passed 2ms
083 - sh3_asyncArithBinMul_test Passed 3ms
084 - sh3_asyncPubArithBinMul_test Passed 1ms
085 - Sh3_f64_basics_test Passed 0ms
086 - Sh3_BinaryEngine_and_test Passed 123ms
087 - Sh3_BinaryEngine_add_test Passed 135ms
088 - Sh3_BinaryEngine_add_msb_test; Passed 124ms
089 - Sh3_convert_b64Matrix_PackedBin_test Passed 2ms
090 - Sh3_Piecewise_plain_test Passed 0ms
091 - Sh3_Piecewise_test Passed 22ms
092 - lowMC_Circuit_test Passed 30ms
093 - lowMC_FileCircuit_test Skipped - USE_JSON not defined 0ms
094 - lowMC_BinFileCircuit_test verify exp 0000101000111011000011010101010100001010100101001001100100110011110000001011110101100111000001011010110101110001100110000101110111100110100101110110101101100001011000101101001001101011011111010011001111010110011101010001000100001100101001100011111100011110
verify act 1110001010010100000100101110101010110110110001110001101001101001011010110111101010111101001100011100001101001111101010010000000111011001000100010110100111110101111011011011111111101001100110011001100111101000101110111101001110101001000110000100010001110111
Failed - /home/simba/aby3/aby3-DB_tests/lowMC.cpp:315 47ms
095 - DB_computeKeys_test Passed 127ms
096 - Perm3p_overwrite_Test Passed 9ms
097 - Perm3p_additive_Test Passed 0ms
098 - Perm3p_subset_Test Passed 1ms
099 - switch_select_test Passed 31ms
100 - switch_duplicate_test Passed 43ms
101 - switch_full_test Passed 63ms
102 - DB_cuckooHash_test Passed 6ms
103 - DB_compare_test Passed 25ms
104 - DB_Intersect_test Passed 146ms
105 - DB_Intersect_sl_test Passed 135ms
106 - DB_Intersect_ls_test Passed 133ms
107 - DB_leftUnion_test Passed 121ms

#############################################
Failed (1)
Passed (95)
skipped (12)
#############################################

Inconsistent results for local and collaborative LowMC evaluations.

Hello Rindal,

Thanks a lot for your great job in developing this library. It really helps me a lot!

I found that there is no unit test comparing the results of evaluating LowMC locally and evaluating the LowMC circuit jointly by three parties. So I just composed a minimal unit test to compare these two cases, in which I set the message to be encrypted as 0 and set all the round keys to 0 for simplicity.

However, I found that their encryption results are inconsistent. I wonder if this is to be expected or if I misunderstood the functionality/usage of the LowMC circuit. I would appreciate it a lot if you could answer this question.

Here is the unit test I wrote. It should compile if you append it to aby3-DB_tests/lowMC.cpp and include some necessary headers.

#include "aby3-DB/LowMC.h"
#include <iostream>
#include <cryptoTools/Common/Timer.h>
#include <cryptoTools/Common/TestCollection.h>
#include <cstdio>

#include "aby3/sh3/Sh3Encryptor.h"
#include "aby3/sh3/Sh3BinaryEvaluator.h"
#include "aby3/Circuit/CircuitLibrary.h"
#include "cryptoTools/Network/IOService.h"
#include "cryptoTools/Common/Log.h"
#include "cryptoTools/Crypto/PRNG.h"

#include <cryptoTools/Circuit/BetaLibrary.h>
#include <iomanip>
#include <atomic>
#include <vector>
#include <string>
#include <random>

std::vector<u64> bitsetToVector(const std::bitset<256>& myBitset) {
    std::vector<uint64_t> result;
    for (std::size_t i = 0; i < 256; i += 64) {
        uint64_t value = 0;
        for (std::size_t j = 0; j < 64; ++j) {
            value |= (myBitset[i + j] << j);
        }
        result.push_back(value);
    }

    return result;
}

void lowMC_CircuitEval_Simplest_test() {
    // >>>>> Eval locally
    LowMC2<> cipher2(false, 1);
    LowMC2<>::block m = 0;
    for (u64 i = 0; i < 13; ++i) cipher2.roundkeys[i] = 0;
    auto c2 = cipher2.encrypt(m);
    std::vector<u64> vec = bitsetToVector(c2);
    printf("Eval locally: ");
    for (u64 i = 0; i < 4; ++i) printf("%lu ", vec[i]);
    printf("\n");

    // >>>>> Eval jointly
    IOService ios;
    Session s01(ios, "127.0.0.1", SessionMode::Server, "01");
    Session s10(ios, "127.0.0.1", SessionMode::Client, "01");
    Session s02(ios, "127.0.0.1", SessionMode::Server, "02");
    Session s20(ios, "127.0.0.1", SessionMode::Client, "02");
    Session s12(ios, "127.0.0.1", SessionMode::Server, "12");
    Session s21(ios, "127.0.0.1", SessionMode::Client, "12");

    Channel chl01 = s01.addChannel("c");
    Channel chl10 = s10.addChannel("c");
    Channel chl02 = s02.addChannel("c");
    Channel chl20 = s20.addChannel("c");
    Channel chl12 = s12.addChannel("c");
    Channel chl21 = s21.addChannel("c");

    CommPkg comms[3], debugComm[3];
    comms[0] = { chl02, chl01 };
    comms[1] = { chl10, chl12 };
    comms[2] = { chl21, chl20 };

    BetaCircuit lowMCCir;

    LowMC2<> cipher1(false, 1);
    for (u64 i = 0; i < 13; ++i) cipher1.roundkeys[i] = 0;
    cipher1.to_enc_circuit(lowMCCir);
    lowMCCir.levelByAndDepth();

    u64 rounds = lowMCCir.mInputs.size() - 1;
    u64 blockSize = 256;
    u64 wordSize = blockSize / 64;

    std::vector<u64> serialized = {0, 0, 0, 0}; // The message to be encrypted
    u64 width = 1;
    i64Matrix kv(width, wordSize);
    std::vector<i64Matrix> keys(rounds);
    for (u64 i = 0; i < rounds; ++i) {
        keys[i].resize(1, wordSize);
        for (u64 j = 0; j < wordSize; ++j) keys[i](0, j) = 0; // The round keys
    }
    for (u64 i = 0; i < serialized.size(); ++i) {
        kv(i / wordSize, i % wordSize) = serialized[i];
    }

    bool success = true;

    auto routine = [&](int pIdx) {
        Sh3Runtime rt(pIdx, comms[pIdx]);
        Sh3Encryptor enc;
        enc.init(pIdx, toBlock(pIdx), toBlock((pIdx + 1) % 3));
        Sh3BinaryEvaluator eval;
        eval.mPrng.SetSeed(toBlock(pIdx));
        Sh3ShareGen gen;
        gen.init(toBlock(pIdx), toBlock((pIdx + 1) % 3));

        // Load the input to secret form
        sPackedBin KV(width, blockSize);
        sPackedBin encKV(width, blockSize);
        std::vector<sPackedBin> Keys(rounds);
        for (u64 i = 0; i < rounds; ++i) {
            Keys[i].reset(1, blockSize);
        }        

        auto task = rt.noDependencies();
        if (pIdx == 0) {
            task = enc.localPackedBinary(task, kv, KV);
        } else {
            task = enc.remotePackedBinary(task, KV);
        }
        if (pIdx == 0) {
            for (u64 i = 0; i < rounds; ++i) {
                task = enc.localPackedBinary(task, keys[i], Keys[i]);
            }
        } else {
            for (u64 i = 0; i < rounds; ++i) {
                task = enc.remotePackedBinary(task, Keys[i]);
            }            
        }
        task.get();

        // Eval the circuit and get the result
        eval.setCir(&lowMCCir, width, gen);
        eval.setInput(0, KV);
        for (u64 i = 0; i < rounds; ++i) {
            eval.setInput(i + 1, Keys[i]);
        }
        eval.asyncEvaluate(rt.noDependencies()).get();
        eval.getOutput(0, encKV);
        i64Matrix enckv(width, wordSize);
        enc.revealAll(rt.noDependencies(), encKV, enckv).get();

        // Compare the result
        if (pIdx == 0) {
            printf("Eval jointly: ");
            for (u64 i = 0; i < wordSize; ++i) printf("%lu ", enckv(0, i));
            printf("\n");
            for (u64 i = 0; i < wordSize; ++i) {
                if (vec[i] != enckv(0, i)) {
                    success = false;
                    break;
                }
            }
        }
    };

    auto t0 = std::thread(routine, 0);
    auto t1 = std::thread(routine, 1);
    auto t2 = std::thread(routine, 2);

    t0.join();
    t1.join();
    t2.join();    

    if (!success) {
        throw UnitTestFail();
    }
}

undefined reference to ...

I linked all libraries in lib/ and thirdparty/unix/ while compiling my own program. but many 'undefined reference to' type error occur:

image

what should i do next...

compling error with gcc 5.5.0 and gcc 5.4.0

Hi guys,

I compiled aby3 and got the following issue.

aby3/aby3-DB/LowMC.h:45:53: error: array must be initialized with a brace-enclosed initializer

built successfully after changing the code snippets ( in aby3/aby3-DB/LowMC.h)
From:
const std::array<u8, 8> Sbox =
{ 0x00, 0x01, 0x03, 0x06, 0x07, 0x04, 0x05, 0x02 };
const std::array<u8, 8> invSbox =
{ 0x00, 0x01, 0x07, 0x02, 0x05, 0x06, 0x03, 0x04 };
To:
const std::array<u8, 8> Sbox =
{{ 0x00, 0x01, 0x03, 0x06, 0x07, 0x04, 0x05, 0x02 }};
const std::array<u8, 8> invSbox =
{{ 0x00, 0x01, 0x07, 0x02, 0x05, 0x06, 0x03, 0x04 }};

refering to the two following links
https://stackoverflow.com/questions/26161373/how-to-initialize-stdarray-in-class-definition
https://stackoverflow.com/questions/8192185/using-stdarray-with-initialization-lists

Question about "LessThen" operator when working with DBs

I have a question about the LessThen operator when working with SelectBundels.
I have checked eric.cpp and tried to do sth. similar. Yet I get results that seem incorrect to me and I am unable to see what I am doing wrong. My Code is very similar to eric.cpp.
code

But when I use it with the following inputs :
A=
a1
C=
c2

I get the following output.
out

I would expect to larger column to look very different.
More like

a1 c1 larger
-586 790 1
240 672 1
-153 422 1
184 328 1
-947 295 1
610 895 1
-395 752 1
383 41 0
-72 30 1
949 878 0

The problem also arises with different inputs. I have tried on two different machines and observed identical behavior.
I am uncertain what causes this behavior and would appreciate help very much.

Distributed example needed

Currently the frontend.exe example is based on a single machine. Is it possible to test in a real 3-machine environment?

Example for multiplication of 2 binary shared values

Sh3Evaluator.cpp seems to have the multiplication functions only for multiplication of 2 arithmetic shared values. In case of binary shares, would the below modified function definition be valid?

Sh3Task Sh3Evaluator::asyncMul(Sh3Task dependency, const sb64& A, const sb64& B, sb64& C)
    {
        return dependency.then([&](CommPkg& comm, Sh3Task self)
            {
                C[0]
                    = A[0] & B[0]
                    ^ A[0] & B[1]
                    ^ A[1] & B[0]
                    ^ mShareGen.getShare();

                comm.mNext.asyncSendCopy(C[0]);
                auto fu = comm.mPrev.asyncRecv(C[1]).share();

                self.then([fu = std::move(fu)](CommPkg& comm, Sh3Task& self){
                    fu.get();
                });
            }).getClosure();
    }

Cannot open include file: 'boost/asio.hpp'

I have followed the Windows Install Instructions until the cloning of function2. Now I have opened aby3.sln in Visual Studio 2019 but I get the error "Cannot open include file: 'boost/asio.hpp'" This is my directory structure

image

I have followed through all the instructions to build libOTe and relic mentioned in the libOTe repository. However in this aby3 repository, considering that boost is installed in libOTe/cryptoTools/thirdparty/win , why is it looking for boost inside the aby3 repository?

Error: ~~~~~~~~~~~~~~~~ Runtime not empty!!! ~~~~~~~~~~~~~~~~

Dear ladnir,
I am working on implementing a program that receives two tables A and B as input and computes the sum per category. The input tables are of the following structure:

A:

key cat
1 1
2 1
3 2

B:

key val
1 10
2 20
3 5

In this example, the computed result should be the following table:

C:

cat val
1 30
2 5

Currently, this is my code:

#include <iostream>
#include <vector>
#include <assert.h>
#include "xtabs.h"

#include "aby3-DB/DBServer.h"
#include <cryptoTools/Network/IOService.h>
#include "aby3/sh3/Sh3Runtime.h"
#include "aby3/sh3/Sh3Encryptor.h"
#include "aby3/sh3/Sh3Evaluator.h"

using namespace oc;
using namespace aby3;
using namespace std;

void xtabs_test(u64 partyIdx, std::vector<int> ids, std::vector<int> values, int nCats)
{
  std::cout << "testing xtabs..." << std::endl;

  IOService ios;

  DBServer srv;

  PRNG prng(ZeroBlock);

  if (partyIdx == 0)
  {
    Session s01(ios, "127.0.0.1:3030", SessionMode::Server, "01");
    Session s02(ios, "127.0.0.1:3031", SessionMode::Server, "02");
    srv.init(0, s02, s01, prng);
  }
  else if (partyIdx == 1)
  {
    Session s10(ios, "127.0.0.1:3030", SessionMode::Client, "01");
    Session s12(ios, "127.0.0.1:3032", SessionMode::Server, "12");
    srv.init(1, s10, s12, prng);
  }
  else
  {
    Session s20(ios, "127.0.0.1:3031", SessionMode::Client, "02");
    Session s21(ios, "127.0.0.1:3032", SessionMode::Client, "12");
    srv.init(2, s21, s20, prng);
  }

  auto keyBitCount = srv.mKeyBitCount;
  std::vector<ColumnInfo>
      catCols = {ColumnInfo{"key", TypeID::IntID, keyBitCount},
                 ColumnInfo{"cat", TypeID::IntID, keyBitCount}},
      valCols = {ColumnInfo{"key", TypeID::IntID, keyBitCount},
                 ColumnInfo{"val", TypeID::IntID, keyBitCount}};

  u64 rows = ids.size();
  assert(ids.size() == rows);
  assert(values.size() == rows);

  Table catData(rows, catCols), valData(rows, valCols);

  // initializes data into Table (still in the clear)
  for (u64 i = 0; i < rows; ++i)
  {
    if (partyIdx == 0)
    {
      catData.mColumns[0].mData(i, 0) = ids[i];
      catData.mColumns[0].mData(i, 1) = values[i];
    }
    else if (partyIdx == 1)
    {
      valData.mColumns[0].mData(i, 0) = ids[i];
      valData.mColumns[0].mData(i, 1) = values[i];
    }
  }

  SharedTable catTable, valTable;
  catTable = (partyIdx == 0) ? srv.localInput(catData) : srv.remoteInput(0);
  valTable = (partyIdx == 1) ? srv.localInput(valData) : srv.remoteInput(1);

  auto res = srv.join(catTable["key"], valTable["key"], {catTable["cat"], valTable["val"]});
  cout << "not reached " << endl;
}

This is not yet finished. As you see, I want to perform a join operation and later sum op the values per category (not implemented yet).
Unfortunately, the last line is not reached, as I get an error on the previous line:

testing xtabs...
testing xtabs...
testing xtabs...
~~~~~~~~~~~~~~~~ Runtime not empty!!! ~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~ Runtime not empty!!! ~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~ Runtime not empty!!! ~~~~~~~~~~~~~~~~
std::bad_alloc
std::bad_array_new_length
std::bad_array_new_length

Do you have an idea why this error pops up? I have read the source code of aby3 but was unable to get to the root of the problem.

Best, Juri

How to config different ip when initing the Sessions

When i tring to cofig three ips for three parties in Sessions's init, the code is correctly compiled, but the logistic task run with segment fault error. P0 is (server, server) mode, P1 is (server, client) mode, P2 is (client, client) mode, P0 is running on ip = 150.1; P1, and P2 are running on ip = 150.138.
if (i == 0) { ip_next = "0.0.0.0"; ip_prev = "0.0.0.0"; }
else if (i == 1) { ip_next = "0.0.0.0"; ip_prev = "192.168.150.1"; }
else if (i == 2) { ip_next = "192.168.150.1"; ip_prev = "192.168.150.138"; }
else { std::cout << "ip config error. " << std::endl; }
Anyone has been trying ip config like this?, what's wrong is it? Thanks.

Question about the experiment setting

Greetings!

I have a question about the experiment setting in the paper "ABY3: A Mixed Protocol Framework for Machine Learning".

In section 6 Experiments (Experimental Setup), this paper says "Using the Linux tc command we consider two network settings: a LAN setting with a shared 10Gbps connection and sub-millisecond RTT latency and a WAN setting with a 40Mbps maximum throughput and 40ms RTT latency". Since in the Linux tc command, Mbps refers to MB/s, whether the WAN setting 40Mbps maximum throughput actually refers to 40MBps?

We would very much appreciate it if you could answer this question.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.