Skip to content

Questions about using the Shamir secret sharing protocol #94

Answered by lschoe
farmerj777 asked this question in Q&A
Discussion options

You must be logged in to vote

Well, if you want to work with a prime field modulo +7 (?), you first create a secure finite field type for that modulus:

secfld = mpc.SecFld(7)

And then you let each party "import" their share in this secure field. If a party has a share s (represented as an integer), then it executes:

a = secfld(s)

Note that for party $i$, with $0\leq i < m$, this means that $s$ should correspond to the value on the Shamir polynomial at $x=i+1$. That's because the numbering of the parties starts at $0$, but at $x=0$ we have the secret itself as value on the Shamir polynomial.
Then afterwards you can check if the value for the secret is correct like this:

print(await mpc.output(a))

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lschoe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #93 on June 05, 2024 08:37.