Skip to content
Discussion options

You must be logged in to vote

The code you've modified above is using encoding and decoding mappings in combination with ElGamal, but these mappings are not (meant to be) homomorphic.

To get started it's better to look at another piece of code in the same demo. Namely, the function election(), which demonstrates the well-known CGS97 election scheme in the passive case:

mpyc/demos/elgamal.py

Lines 79 to 103 in 98ac889

async def election(secgrp):
"""Boardroom election between all MPC parties."""
group = secgrp.group
# Create ElGamal key pair:
g = group.generator
x, h = await keygen(g)
# Each party encrypts a random vote:
v = random.randint(0, 1)
print(f'''My vote: {v

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 #106 on June 09, 2025 12:42.