Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust ballot contract #5

Closed
2 tasks done
rmatil opened this issue Feb 17, 2018 · 0 comments
Closed
2 tasks done

Adjust ballot contract #5

rmatil opened this issue Feb 17, 2018 · 0 comments
Assignees

Comments

@rmatil
Copy link
Contributor

rmatil commented Feb 17, 2018

Consider ElGamal encryption to be as follows:

  E(m) = (G, H) = (g^r, h^r * g^m), with h = g^x and m = message

Then, the contract should include dedicated arguments in the method vote for:

  • A string representing the ciphertext, i.e. (G, H)
  • A string representing the corresponding proof

NOTE the ballot contract should not assume anything about how the values are encoded. Currently they are in base 36, as this is the largest radix Java supports. However, this may change, in case the length of the native datatypes of Ethereum does not suffice to store these values.

-- EDIT --
NOTE that using dedicated arguments to the vote method is not allowed due to the restricted amount of local variables one can declare in an Ethereum smart contract function. Causes

Stack too deep, try removing local variables

From http://james.carlyle.space/2015/07/22/solidity-stack-too-deep/:

Depending on what you do, you can have around 16 local variables (including parameters and return parameters).
So every input parameter to the function takes one variable, and each return value takes one variable, and each local declaration takes another variable, and references to storage take two

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant