command.py 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import os
  2. def install():
  3. print(("git submodule init"))
  4. print(os.system("git submodule init"))
  5. print(("git submodule update"))
  6. print(os.system("git submodule update"))
  7. print(("mkdir ./MP-SPDZ/Player-Data"))
  8. print(os.system("mkdir ./MP-SPDZ/Player-Data"))
  9. print(("apt-get install automake build-essential git libboost-dev libboost-thread-dev libsodium-dev libssl-dev libtool m4 python texinfo yasm"))
  10. print(os.system("apt-get install automake build-essential git libboost-dev libboost-thread-dev libsodium-dev libssl-dev libtool m4 python texinfo yasm"))
  11. print(("./MP-SPDZ/Scripts/tldr.sh"))
  12. print(os.system("./MP-SPDZ/Scripts/tldr.sh"))
  13. print(("cd MP-SPDZ && ls && make -j8 tldr"))
  14. print(os.system("cd MP-SPDZ && ls && make -j8 tldr"))
  15. print(("create Link from Player"))
  16. print(os.system("ln -s MP-SPDZ/Player-Data/ ."))
  17. print(("create Link from local"))
  18. print(os.system("ln -s MP-SPDZ/local/ ."))
  19. print(("create Link from Programs"))
  20. print(os.system("ln -s MP-SPDZ/Programs/ ."))
  21. print(("./MP-SPDZ/compile.py tutorial"))
  22. print(os.system("./MP-SPDZ/compile.py tutorial"))
  23. print(("cd MP-SPDZ && ls && make -j8 mascot-party"))
  24. print(os.system("cd MP-SPDZ && ls && make -j8 mascot"))
  25. print(("echo 1 2 3 4 > ./Player-Data/Input-P0-0"))
  26. print(os.system("echo 1 2 3 4 > ./Player-Data/Input-P0-0"))
  27. print(("echo 1 2 3 4 > ./Player-Data/Input-P1-0"))
  28. print(os.system("echo 1 2 3 4 > ./Player-Data/Input-P1-0"))
  29. print(("./MP-SPDZ/Scripts/mascot.sh tutorial"))
  30. print(os.system("./MP-SPDZ/Scripts/mascot.sh tutorial"))
  31. print(("\n"))
  32. os.system("cd tls/pycryptodome && python setup.py install")
  33. a = os.popen('cd ./tls/pycryptodome/build && ls').read()
  34. b = a.split("\n")
  35. if b[1].startswith("lib"):
  36. os.system("mv tls/pycryptodome/build/"+b[1]+"/Crypto tls/")
  37. def comp(a):
  38. print(("cp to Programs"))
  39. print(os.system("cp ./mpc/"+a+".mpc ./Programs/Source/"))
  40. print(("compile"))
  41. print(os.system("./MP-SPDZ/compile.py "+a))
  42. def compCrypto(a):
  43. os.system("rm -rf tls/Crypto")
  44. os.system("cd tls/pycryptodome && python setup.py install")
  45. a = os.popen('cd ./tls/pycryptodome/build && ls').read()
  46. b = a.split("\n")
  47. if b[1].startswith("lib"):
  48. os.system("mv tls/pycryptodome/build/"+b[1]+"/Crypto tls/")