Skip to content
Snippets Groups Projects
Commit c0ef6819 authored by Mayank's avatar Mayank
Browse files

Cleaned and added another arithmetic example

parent 926ed3c7
No related branches found
No related tags found
No related merge requests found
......@@ -9,21 +9,40 @@ eval `opam config env`
echo "SWITCHED"
# make EzPC again
cd EzPC/
cd ../EzPC/
make
cd ..
echo "================================================================"
echo "Compiling docker binary ops example to ABY"
echo "================================================================"
cd EzPC/docker_test
../ezpc docker_bin_example.ezpc
echo "================================================================"
echo "Copying generated files to latest ABY examples directory"
cp docker_bin_example0.cpp ../../../ABY-latest/ABY/src/examples/docker-test/common/millionaire_prob.cpp
# Add all perceptron files to CMakeLists
echo "Select which example to compile"
read -p "Enter 0 for binary example or 1 for arithmetic example: " choice
if [ $choice -lt 1 ]
then
echo "================================================================"
echo "Compiling docker binary ops example to ABY"
echo "================================================================"
../ezpc docker_bin_example.ezpc
echo "================================================================"
echo "Copying generated files to latest ABY examples directory"
echo "================================================================"
cp docker_bin_example0.cpp ../../../ABY-latest/ABY/src/examples/docker-test/common/millionaire_prob.cpp
else
echo "================================================================"
echo "Compiling docker arithmetic ops example to ABY"
echo "================================================================"
../ezpc docker_arith_example.ezpc
echo "================================================================"
echo "Copying generated files to latest ABY examples directory"
echo "================================================================"
cp docker_arith_example0.cpp ../../../ABY-latest/ABY/src/examples/docker-test/common/millionaire_prob.cpp
fi
# Add all example files to CMakeLists
cd ../../../ABY-latest/ABY/src/examples/docker-test/
> CMakeLists.txt
echo 'add_executable(docker_binop_example millionaire_prob_test.cpp common/millionaire_prob.cpp common/millionaire_prob.h)' >> CMakeLists.txt
......@@ -33,6 +52,10 @@ echo 'target_link_libraries(docker_binop_example ABY::aby ENCRYPTO_utils::encryp
cd ../../../build
make
cd ../../../ezpc/
cd ../../../EzPC/
echo "DONE"
echo "================================================================"
echo "Executables are ready. They can be found in ABY/build/bin"
echo "================================================================"
#!/bin/bash
cd ../ABY-latest/ABY/build/bin/
cd ../../ABY-latest/ABY/build/bin/
rm -r client
mkdir client
cp docker_binop_example* client/.
......@@ -9,4 +9,4 @@ pwd
./docker_binop_example -r 0
cd ../../../../../ezpc
cd ../../../../../EzPC
#!/bin/bash
cd ../ABY-latest/ABY/build/bin/
cd ../../ABY-latest/ABY/build/bin/
rm -r server
mkdir server
cp docker_binop_example* server/.
......@@ -9,4 +9,4 @@ pwd
./docker_binop_example -r 1
cd ../../../../../ezpc
cd ../../../../../EzPC
def void main() {
uint32_al a = 5u;
uint32_al b = 10u;
uint32_al c;
c = a+b;
output(ALL, c);
c = b-a;
output(ALL, c);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment