MP-SPDZ icon indicating copy to clipboard operation
MP-SPDZ copied to clipboard

Questions about -DINSECURE mode (-F flag)

Open kanav99 opened this issue 1 year ago • 2 comments

Hi,

I am using -DINSECURE flag while compiling and -F while running, to do online phase benchmarking. I have two questions:

  1. How do I get the size of preprocessing material being used for a particular .mpc file? The binary prints the communication in MB. I need a similar number for the preprocessing material it used.

  2. When I run using -F flag, I notice that it prints REUSING DATA - ONLY FOR BENCHMARKING. Does it mean that preprocessing material is being reused? How do I prevent this?

Thanks!

kanav99 avatar Jul 31 '24 09:07 kanav99

  1. You can run the binary with the --verbose argument for a detailed output.
  2. Yes. This is allow continuing the online benchmarking when the preprocessing data on disk runs out. You can prevent this by running ./Fake-Offline.x -d <number> ... with <number> being sufficiently high. Try the maximum of the output with --verbose.

mkskeller avatar Aug 01 '24 01:08 mkskeller

Thank you so much for the response!

--verbose prints all the required preprocessing material in terms of number of triples, bit triples, edabits, dabits etc. Can I get this is MB somehow? Or do I have to calculate manually?

For example, in semi-honest case, a bit triple is 3 bits worth of preprocessing per party. However, in malicious case, a bit triple would be 3*(1+2t) bits, where t is the size of tag, assuming it uses BDOZ style shares for bits.

If need to be calculated manually, is it possible to get exact expressions for each of these preprocessing material types?

Thank you once again!

kanav99 avatar Aug 06 '24 11:08 kanav99

You figures this out by running specific programs like

sint.get_random_triple(size=1000)

This works for triples, dabits, and edabits. For bit triples, use

a = sbit.get_type(1000)
a & a

mkskeller avatar Aug 07 '24 00:08 mkskeller

Thanks!

I ran

sint.get_random_triple(size=1000)

using

python3 compile.py -R 64 comp
./spdz2k-party.x -N 2 --verbose -h 172.31.42.195 -F comp -p 0

and I get 0 MB communication. If I remove -F flag, I suppose that I will get the communication to "generate" these randomness, not the "preprocessing size". Am I right about this? If so, is there any way around?

kanav99 avatar Aug 12 '24 06:08 kanav99

Indeed, I misunderstood. There is no ready facility computing the storage requirements, so you'll need to work it out yourself. Going back to your earlier question, MP-SPDZ doesn't use BDOZ but FKOS15, so there is only one tag per value.

mkskeller avatar Aug 12 '24 07:08 mkskeller

Awesome, thanks for the help, I have a better understanding now!

kanav99 avatar Aug 14 '24 10:08 kanav99