siv-org / siv

Secure Internet Voting protocol
https://siv.org
Other
12 stars 6 forks source link

Ballot Designer should warn if options.name field is too long #61

Open dsernst opened 2 years ago

dsernst commented 2 years ago

While working on script for video demo, ran into this error when trying to encrypt sample votes:

image
dsernst commented 2 years ago

Ballot designer allowed me to create this schema:

[
  {
    "id": "mayor",
    "title": "Who should be elected our next mayor of Greeley?",
    "options": [
      {
        "name": "Kassandra Granlund"
      },
      {
        "name": "Byron Rhudy"
      },
      {
        "name": "Nancy Risch"
      },
      {
        "name": "Elin Vitucci"
      }
    ],
    "write_in_allowed": false
  },
  {
    "id": "us_house_rep",
    "title": "Who should be elected our next US House Representative?",
    "options": [
      {
        "name": "Will Bilderback",
        "sub": "(No Party Preference)"
      },
      {
        "name": "Tyler Goodall",
        "sub": "(Justice Party)"
      },
      {
        "name": "Lilah Notti",
        "sub": "(Liberty Party)"
      }
    ],
    "write_in_allowed": false
  }
]
dsernst commented 2 years ago

5425-1892-6026:Kassandra Granlund is too long

33 bytes instead of 30

dsernst commented 2 years ago

Would also be good to store the verification code more efficiently... Since it's only a 12 digit number, that's 40 bits / 5 bytes... but as currently written it's taking up 14 bytes. 😕

But this deserves its own separate issue. https://github.com/dsernst/siv/issues/63