MP-SPDZ -v0.3.2(一)部署+小测试

环境信息:

macos Ventura 13.0.1
ubuntu 64 jammy 18.04 4核8G

准备安装包

下载zip:https://gitcode.net/mirrors/data61/MP-SPDZ/-/tree/v0.3.2

#本地
sftp yevhen@172.16.32.128
#Hxt991125
put /Users/houxiaoting/Desktop/mpc框架/MP-SPDZ-v0.3.2.zip 
#远程登录ubuntu 
ssh yevhen@172.16.32.128
#解压
unzip MP-SPDZ-v0.3.2.zip
cd MP-SPDZ-v0.3.2/

开始部署

#安装工具包
apt-get install automake build-essential git libboost-dev libboost-thread-dev libntl-dev libsodium-dev libssl-dev libtool m4 python3 texinfo yasm

makefile 编译

make -j 8 tldr

tutorial测试

./compile.py tutorial
Default bit length: 64
Default security parameter: 40
Compiling file /home/yevhen/下载/MP-SPDZ-v0.3.2/Programs/Source/tutorial.mpc
WARNING: Order of memory instructions not preserved, errors possible
Writing to /home/yevhen/下载/MP-SPDZ-v0.3.2/Programs/Schedules/tutorial.sch
Writing to /home/yevhen/下载/MP-SPDZ-v0.3.2/Programs/Bytecode/tutorial-0.bc
Program requires at most:
           4 integer inputs from player 0
           4 integer inputs from player 1
        5458 integer bits
        2520 integer triples
           1 matrix multiplications (3x2 * 2x2)
         239 virtual machine rounds

创建新目录Party-Data,编写双方输入数

mkdir Party-Data
echo 1 2 3 4 > Player-Data/Input-P0-0
echo 1 2 3 4 > Player-Data/Input-P1-0

执行tutorial程序

Scripts/mascot.sh tutorial
Running /home/yevhen/下载/MP-SPDZ-v0.3.2/Scripts/../mascot-party.x 0 tutorial -pn 14929 -h localhost -N 2
Running /home/yevhen/下载/MP-SPDZ-v0.3.2/Scripts/../mascot-party.x 1 tutorial -pn 14929 -h localhost -N 2
Using security parameter 40
got 1 from player 0
got 1 from player 1
expected 3, got 3
expected 2, got 2
expected -1, got -1
expected 2, got 2
expected 1, got 1
expected 1, got 1
expected 0, got 0
expected 0, got 0
expected 0, got 0
expected 1, got 1
expected 2, got 2
expected 9702, got 9702
expected 1.9, got 1.9
expected 2.1, got 2.1
expected -0.2, got -0.2
expected -20, got -20
expected 0, got 0
expected 0, got 0
expected 1, got 1
expected 1, got 1
expected 0, got 0
expected 1, got 1
expected -0.1, got -0.1
Party 0: please input three numbers not adding up to zero
Party 1: please input any three numbers
weighted average: 3.222
expected 2, got 2
expected 3, got 3
Significant amount of unused triples of SPDZ gfp. For more accurate benchmarks, consider reducing the batch size with -b.
The following timing is inclusive preprocessing.
Time = 2.02713 seconds
Data sent = 223.717 MB in ~685 rounds (party 0)
Global data sent = 447.433 MB (all parties)
This program might benefit from some protocol options.
Consider adding the following at the beginning of 'tutorial.mpc':
	program.use_edabit(True)

tutorial编译成功

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值