data61 / MP-SPDZ

Versatile framework for multi-party computation
Other
944 stars 280 forks source link

Get many programs in only one mpc file #1468

Closed f-hy closed 3 months ago

f-hy commented 3 months ago

Can I get many programs in only one mpc file? I find that when I give the code:

#fs.mpc
from Compiler.compilerLib import Compiler
@compiler.register_function('fs0')
def fs0():
  print_ln("fs0")
@compiler.register_function('fs1')
def fs1():
  print_ln("fs1")
@compiler.register_function('fs2')
def fs2():
  print_ln("fs2")

then I will get only one program named "fs2*" via:

python Programs/Source/fs.mpc

fs0 and fs1 not compiled.

mkskeller commented 3 months ago

You have to run compiler.compile_func() after every call of register_function.