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

Module operation over shares

Open QDUST1 opened this issue 3 months ago • 6 comments

Given a public prime R and each party get a share of "a", labeled as a_i , can I let each party locally compute a_i mod R ? Or can I let them cooperatively compute the share of r = (a mod R)?

QDUST1 avatar Oct 13 '25 02:10 QDUST1

As far as I know, this depends on the secret-sharing scheme being used. Which protocol are you intending to use?

vincent-ehrmanntraut avatar Oct 13 '25 05:10 vincent-ehrmanntraut

Replicated secret sharing among three parties, I surpose

QDUST1 avatar Oct 13 '25 05:10 QDUST1

Assuming the question is about the facilities of MP-SPDZ: The local computation would require using either the C++ interface or the client interface [1] as the virtual machine design doesn't support that. Secret computation is only supported if R is a power of two via the mod2m function [2]. More generally, I would expect that the local computation produces a random result unless R divides the computation modulus and the secret sharing doesn't have a MAC (as is the case with replicated secret sharing). MP-SPDZ already makes use of this when converting between arithmetic and binary with power-of-two moduli in the arithmetic domain.

[1] https://mp-spdz.readthedocs.io/en/latest/client-interface.html [2] https://mp-spdz.readthedocs.io/en/latest/Compiler.html#Compiler.types.sint.mod2m

mkskeller avatar Oct 13 '25 05:10 mkskeller

Can I directly set the modulus of the secret sharing scheme to be a multiple of R?

QDUST1 avatar Oct 13 '25 06:10 QDUST1

MP-SPDZ only supports moduli that are a power of two or a prime. This implies that R would need to be a power of two as well. Replicated secret sharing does support any modulus in theory, however.

mkskeller avatar Oct 13 '25 06:10 mkskeller

That's all I wanted to ask! So thankful for your quick response!

QDUST1 avatar Oct 13 '25 07:10 QDUST1