mp-spdz测试版本:0.3.0
使用到的测试程序:./Program/Source/test_sbitint.mpc
- 首先对程序进行编译:
./compile.py -B 32 test_sbitint
输出:
ubuntu@ubuntu:~/spdz030$ ./compile.py -B 32 test_sbitint
Default bit length: 32
Default security parameter: 40
Compiling file /home/ubuntu/spdz030/Programs/Source/test_sbitint.mpc
Not merging instructions in tape test_sbitint-0
Writing to /home/ubuntu/spdz030/Programs/Schedules/test_sbitint.sch
Writing to /home/ubuntu/spdz030/Programs/Bytecode/test_sbitint-0.bc
Program requires at most:
4404 bit triples
- 执行程序
首先是不将结果输出到文件,直接打印在屏幕上,使用命令./emulate.x test_sbitint
输出结果为:
ubuntu@ubuntu:~/spdz030$ ./emulate.x test_sbitint
Trying to run 64-bit computation
16: 0 5 0x5
17: 0 1 0x1
18: 0 0 0x0
19: 0 1 0x1
20: 0 1 0x1
21: 0 4 0x4
23: 0 6 0x6
24: 0 6 0x6
25: 0 6 0x6
27: -4294967296 -1 0xffffffff
28: 0 2 0x2
29: 0 1 0x1
31: 0 4 0x4
35: 0 -3 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
37: 0 2 0x2
38: 0 2 0x2
The following timing is inclusive preprocessing.
Time = 0.00297332 seconds
Data sent = 0 MB in ~1 rounds (party 0)
Global data sent = 0 MB (all parties)
使用-OF将结果输出到文件里,使用命令:./emulate.x -OF outPut test_sbitint
outPut是输出的文件名一部分,spdz库会根据这个名字,创建文件outPut-P0-0
,结果被保存在这里面。
输出信息:
ubuntu@ubuntu:~/spdz030$ ./emulate.x -OF outPut test_sbitint
Trying to run 64-bit computation
The following timing is inclusive preprocessing.
Time = 0.00320688 seconds
Data sent = 0 MB in ~1 rounds (party 0)
Global data sent = 0 MB (all parties)
运行命令后,屏幕上没有了输出结果,在根目录文件夹内多了一个文件
查看里面的内容:
ubuntu@ubuntu:~/spdz030$ cat outPut-P0-0
16: 0 5 0x5
17: 0 1 0x1
18: 0 0 0x0
19: 0 1 0x1
20: 0 1 0x1
21: 0 4 0x4
23: 0 6 0x6
24: 0 6 0x6
25: 0 6 0x6
27: -4294967296 -1 0xffffffff
28: 0 2 0x2
29: 0 1 0x1
31: 0 4 0x4
35: 0 -3 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
35: 0 5 0x5
(上面为部分结果,以下内容省略)