Skip to content

Commit

Permalink
Merge pull request #45 from sequentech/rebrand-to-sequentech
Browse files Browse the repository at this point in the history
Rebrand from nVotes to Sequent Tech
  • Loading branch information
edulix authored Apr 5, 2022
2 parents c21d443 + d23e0e2 commit 52b4a0f
Show file tree
Hide file tree
Showing 24 changed files with 206 additions and 199 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test the agora-verifier
name: Test the election-verifier

on:
push:
Expand Down Expand Up @@ -31,15 +31,15 @@ jobs:
- name: Install internal dependencies
run: |
export INTERNAL_GIT_VERSION="master"
git clone https://github.com/agoravoting/agora-tally.git
cd agora-tally && git checkout "${INTERNAL_GIT_VERSION}" && cd ..
mv agora-tally/agora_tally .
git clone https://github.com/sequentech/tally-methods.git
cd tally-methods && git checkout "${INTERNAL_GIT_VERSION}" && cd ..
mv tally-methods/tally_methods .
git clone https://github.com/agoravoting/agora-results.git
cd agora-results && git checkout "${INTERNAL_GIT_VERSION}" && cd ..
mv agora-results/ agora-results2
mv agora-results2/agora_results .
mv agora-results2/agora-results .
git clone https://github.com/sequentech/tally-pipes.git
cd tally-pipes && git checkout "${INTERNAL_GIT_VERSION}" && cd ..
mv tally-pipes/ tally-pipes2
mv tally-pipes2/tally_pipes .
mv tally-pipes2/tally-pipes .
# This is for caching purposes, just following the steps in
# https://www.scala-sbt.org/1.x/docs/GitHub-Actions-with-sbt.html
Expand All @@ -64,5 +64,5 @@ jobs:
- uses: actions/upload-artifact@v2
with:
name: agora-verifier-binary
path: ./agora-verifier
name: election-verifier-binary
path: ./election-verifier
6 changes: 3 additions & 3 deletions .ort.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
resolutions:
rule_violations:
- message: "The project SpdxDocumentFile::agora-verifier:.* has a dependency licensed under the ScanCode copyleft categorized license AGPL-3.0-only."
- message: "The project SpdxDocumentFile::election-verifier:.* has a dependency licensed under the ScanCode copyleft categorized license AGPL-3.0-only."
reason: "LICENSE_ACQUIRED_EXCEPTION"
comment: "The project is open source so it's normal that it's set as such."

- message: "The package (Maven:default:agora-verifier.*|SpdxDocumentFile::agora-(verifier|tally|results)):.* has the declared ScanCode copyleft catalogized license AGPL-3.0-only."
- message: "The package (Maven:default:election-verifier.*|SpdxDocumentFile::sequent-(verifier|tally|results)):.* has the declared ScanCode copyleft catalogized license AGPL-3.0-only."
reason: "DYNAMIC_LINKAGE_EXCEPTION"
comment: "This is linked dynamicly so it's not a problem and besides, those are open source projects by us (nVotes) so it's normal they have an open source license."
comment: "This is linked dynamicly so it's not a problem and besides, those are open source projects by us (Sequent) so it's normal they have an open source license."

4 changes: 2 additions & 2 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Eduardo Robles Elvira <edulix AT agoravoting DOT com>
David Ruescas <david AT agoravoting DOT com>
Eduardo Robles Elvira <edulix@sequentech.io>
David Ruescas <david@sequentech.io>
Daniel García Moreno <danigm AT wadobo DOT com>
117 changes: 62 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# agora-verifier
# election-verifier

`agora-verifier` performs universal verification of an election tally in
[nVotes] platform.
`election-verifier` performs universal verification of an election tally in
[Sequent] platform.

The verifications performed are:
1. `recorded-as-cast`: Allows anyone to verify the inclusion of an encrypted
ballot in the tally.
2. `counted-as-recorded`: Allows anyone to verify that with the given set of
encrypted ballots, the calculated election results are correct. This
includes:
- The usage of [vfork] library to verify the `Zero Knowledge Proofs` of:
- The usage of [mixnet] library to verify the `Zero Knowledge Proofs` of:
- Key Generation
- Shuffling
- Joint-decryption of the encrypted ballots
- The calculation of election results from the plaintext ballots verified in
the previous Joint-decryption verification step, using the [agora-results]
and [agora-tally] libraries.
the previous Joint-decryption verification step, using the [tally-pipes]
and [tally-methods] libraries.

## Usage

You need to be running inside an `Ubuntu 20.04 LTS` operative system on a
`x86_64` machine. You also need to have `openjdk` version 8 installed.
`agora-verifier` is currently untested in other system configurations.
`election-verifier` is currently untested in other system configurations.

If you don't have a tally to verify but you want to test `agora-verifier`, you
If you don't have a tally to verify but you want to test `election-verifier`, you
can find an example of some tallies to verify in `testdata/` directory in this
repository. Note that you need to use a matching software version of
`agora-verifier` and this tally to make it work.
`election-verifier` and this tally to make it work.

In the `testdata/` directory, the file `12.tar` is a valid election tally, and
all the other tallies contain different kind of invalid errors that would make
Expand All @@ -39,22 +39,22 @@ valid ballot tracker is

### Performing `counted-as-recorded` verification

Once you have the `agora-verifier` binary and a tally to verify, you can perform
Once you have the `election-verifier` binary and a tally to verify, you can perform
`counted-as-recorded` verification of the tally by running the following
command:

```bash
chmod +x agora-verifier
# Execute by using ./agora-verifier <path-to-tally.tar>
./agora-verifier testdata/12.tar
chmod +x election-verifier
# Execute by using ./election-verifier <path-to-tally.tar>
./election-verifier testdata/12.tar
```

**Tip:** You can use one of the invalid testdata tallies and see how
`agora-verifier` fails on different kind of tally verifications.
`election-verifier` fails on different kind of tally verifications.

### Performing `recorded-as-cast` verification

You can also verify the inclusion of a ballot tracker with `agora-verifier` in
You can also verify the inclusion of a ballot tracker with `election-verifier` in
the list of encrypted ballots of the election tally. This is the so-called
`recorded-as-cast` verification. Note that the ballot tracker is just a hash of
the ballot. If the ballot tracker is
Expand All @@ -63,33 +63,33 @@ perform this verification on the tally `tally.tar` you would run the
following command:

```bash
chmod +x agora-verifier
# Execute by using ./agora-verifier <path-to-tally.tar> <ballot-tracker>
./agora-verifier testdata/12.tar 09684d8abd01c2227432bc6302e669fac4e4b3e7251f24c4a9c938683fa44705
chmod +x election-verifier
# Execute by using ./election-verifier <path-to-tally.tar> <ballot-tracker>
./election-verifier testdata/12.tar 09684d8abd01c2227432bc6302e669fac4e4b3e7251f24c4a9c938683fa44705
```

**Tip:** You can try to make up an invalid ballot-tracker to see that
`agora-verifier` does not find it in the tally and fails.
`election-verifier` does not find it in the tally and fails.

## Building `agora-verifier`
## Building `election-verifier`

### Automatic builds

Compilation and installation of `agora-verifier` is already automated in:
- [agora-dev-box]: Any new [nVotes] platform deployment automatically compiles
and ships the `agora-verifier` binary with election results, showing voters a
link to download `agora-verifier` in the public election page once the
Compilation and installation of `election-verifier` is already automated in:
- [deployment-tool]: Any new [Sequent] platform deployment automatically compiles
and ships the `election-verifier` binary with election results, showing voters a
link to download `election-verifier` in the public election page once the
election results are published. See [deployment-guide] for instructions on how
to run `agora-dev-box` to deploy the whole system.
- [unit-tests]: `agora-verifier` CI pipeline automatically compiles and runs
`agora-verifier` unittests on github. You can directly download the
`agora-verifier` binary used and generated in each run of the
to run `deployment-tool` to deploy the whole system.
- [unit-tests]: `election-verifier` CI pipeline automatically compiles and runs
`election-verifier` unittests on github. You can directly download the
`election-verifier` binary used and generated in each run of the
[unit-tests Github Actions Workflow] from the summary page of that workflow
run.

### Manual Build

To manually build yourself the `agora-verifier` executable, please follow the
To manually build yourself the `election-verifier` executable, please follow the
instructions below.

**1. System requirements**
Expand All @@ -100,7 +100,7 @@ configuration.

**2. Install dependencies**

`agora-verifier` uses openjdk `8`, sbt `0.13.18`, and also the `uuencode`
`election-verifier` uses openjdk `8`, sbt `0.13.18`, and also the `uuencode`
encoding tools. Let's install them first:

```bash
Expand All @@ -113,53 +113,60 @@ sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/ja
```

Next, we will be installing the internal dependencies, i.e. dependencies of
`agora-verifier` that are also part of [nVotes] platform: [agora-results] and
[agora-tally]. Please change the `INTERNAL_GIT_VERSION` variable to the
`election-verifier` that are also part of [Sequent] platform: [tally-pipes] and
[tally-methods]. Please change the `INTERNAL_GIT_VERSION` variable to the
appropiate version to use in your case.

> :warning: **Note** You need to change the `INTERNAL_GIT_VERSION` you should be
using depending on the version of [nVotes] platform used to run the election you
want to verify. In this example, we're using version `5.0.0` of [nVotes]
using depending on the version of [Sequent] platform used to run the election you
want to verify. In this example, we're using version `5.0.0` of [Sequent]
platform.

```bash
export INTERNAL_GIT_VERSION="5.0.0"
git clone https://github.com/agoravoting/agora-verifier.git
cd agora-verifier
git clone https://github.com/sequentech/election-verifier.git
cd election-verifier
git checkout "${INTERNAL_GIT_VERSION}"

git clone https://github.com/agoravoting/agora-tally.git
cd agora-tally && git checkout "${INTERNAL_GIT_VERSION}" && cd ..
mv agora-tally/agora_tally .
git clone https://github.com/sequentech/tally-methods.git
cd tally-methods && git checkout "${INTERNAL_GIT_VERSION}" && cd ..
mv tally-methods/tally_methods .

git clone https://github.com/agoravoting/agora-results.git
cd agora-results && git checkout "${INTERNAL_GIT_VERSION}" && cd ..
mv agora-results/ agora-results2
mv agora-results2/agora_results .
mv agora-results2/agora-results .
git clone https://github.com/sequentech/tally-pipes.git
cd tally-pipes && git checkout "${INTERNAL_GIT_VERSION}" && cd ..
mv tally-pipes/ tally-pipes2
mv tally-pipes2/tally_pipes .
mv tally-pipes2/tally-pipes .
```

**3. Building and packaging**

To compile and package the `agora-verifier` binary, please run:
To compile and package the `election-verifier` binary, please run:

```bash
sbt clean proguard:proguard
./package.sh
```

This will generate the `agora-verifier` executable in the current working
This will generate the `election-verifier` executable in the current working
directory. You can see it's working by running:

```bash
./agora-verifier testdata/12.tar
./election-verifier testdata/12.tar
```

[nVotes]: https://nvotes.com
[vfork]: https://github.com/agoravoting/vfork
[agora-results]: https://github.com/agoravoting/agora-results
[agora-tally]: https://github.com/agoravoting/agora-tally
[agora-dev-box]: https://github.com/agoravoting/agora-dev-box
[unit-tests]: https://github.com/agoravoting/agora-verifier/blob/master/.github/workflows/unittests.yml
[deployment-guide]: https://agoravoting.github.io/admin-manual/docs/deployment/guide/
[unit-tests Github Actions Workflow]: https://github.com/agoravoting/agora-verifier/actions/workflows/unittests.yml
**4. Notes on `lib/mixnet.jar`**

This library depends on `mixnet.jar`, which for simplicity is currently
included directly in the git repository. You can build this file from the
[mixnet] repository and copy it back to `lib/mixnet.jar` before executing
the build.

[Sequent]: https://sequentech.io
[mixnet]: https://github.com/sequentech/mixnet
[tally-pipes]: https://github.com/sequentech/tally-pipes
[tally-methods]: https://github.com/sequentech/tally-methods
[deployment-tool]: https://github.com/sequentech/deployment-tool
[unit-tests]: https://github.com/sequentech/election-verifier/blob/master/.github/workflows/unittests.yml
[deployment-guide]: https://sequent.github.io/documentation/docs/deployment/guide/
[unit-tests Github Actions Workflow]: https://github.com/sequentech/election-verifier/actions/workflows/unittests.yml
1 change: 0 additions & 1 deletion bin/agora-verifier.md5

This file was deleted.

14 changes: 7 additions & 7 deletions bin/agora-verifier → bin/election-verifier
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/bin/sh

# This file is part of agora-verifier.
# Copyright (C) 2015-2016 Agora Voting SL <[email protected]>
# This file is part of election-verifier.
# Copyright (C) 2015-2016 Sequent Tech Inc <[email protected]>

# agora-verifier is free software: you can redistribute it and/or modify
# election-verifier is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License.

# agora-verifier is distributed in the hope that it will be useful,
# election-verifier is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.

# You should have received a copy of the GNU Lesser General Public License
# along with agora-verifier. If not, see <http://www.gnu.org/licenses/>.
# along with election-verifier. If not, see <http://www.gnu.org/licenses/>.

dir=`dirname $0`;
if [ x$dir = "x." ]
Expand All @@ -24,9 +24,9 @@ base=`basename $0`;
path=$(mktemp -d)
tally=$(echo $(dirname $(readlink -e $1))/$(basename $1))

(cd $path; uudecode -o /dev/stdout $dir/$base | tar zxf -; cd $path/agora-verifier/; /usr/bin/env python3 verify.py $tally $2; rm -rf $path)
(cd $path; uudecode -o /dev/stdout $dir/$base | tar zxf -; cd $path/election-verifier/; /usr/bin/env python3 verify.py $tally $2; rm -rf $path)
exit 0;
begin 644 agora-verifier.tar.gz
begin 644 election-verifier.tar.gz
M'XL(`$;$ZU0``^R]!5R53;<WO!&D$:4;!*2[&^GN;NGN;@$!:6GI$A"1;I!0
ME.YNI+N[OVL;]^U=SWG/>Y[S?N_W^\[`[+EFUG]FUJQ9L]::O;>B;VKKH$_K
M8NQ@;F)N[$`/^N](#$!B9V7]5@+IS^6W9T8F%G8F=A8F1@8V$`-086,&$;'^
Expand Down
1 change: 1 addition & 0 deletions bin/election-verifier.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fecbdbd4db90a1df74beb47f6aefb70b bin/election-verifier
32 changes: 16 additions & 16 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
// This file is part of agora-verifier.
// Copyright (C) 2015-2016 Agora Voting SL <[email protected]>
// This file is part of election-verifier.
// Copyright (C) 2015-2016 Sequent Tech Inc <[email protected]>

// agora-verifier is free software: you can redistribute it and/or modify
// election-verifier is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License.

// agora-verifier is distributed in the hope that it will be useful,
// election-verifier is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.

// You should have received a copy of the GNU Lesser General Public License
// along with agora-verifier. If not, see <http://www.gnu.org/licenses/>.
// along with election-verifier. If not, see <http://www.gnu.org/licenses/>.

name := "agora-verifier"
name := "election-verifier"

version := "master"

scalaVersion := "2.10.3"

mainClass := Some("org.agoravoting.agora.Verifier")
mainClass := Some("org.sequent.sequent.Verifier")

startYear := Some(2015)

homepage := Some(url("https://github.com/agoravoting/agora-verifier"))
homepage := Some(url("https://github.com/sequentech/election-verifier"))

licenses += ("AGPL-3.0", url("https://www.gnu.org/licenses/agpl-3.0.en.html"))

organizationName := "Agora Voting SL"
organizationName := "Sequent Tech Inc"

organizationHomepage := Some(url("https://nvotes.com"))
organizationHomepage := Some(url("https://sequentech.io"))


javaOptions in run += "-Djava.security.egd=file:/dev/./urandom"
Expand All @@ -50,15 +50,15 @@ ProguardKeys.options in Proguard ++= Seq("-dontnote", "-dontwarn", "-ignorewarni

// ProguardKeys.options in Proguard ++= Seq("-dontnote", "-dontwarn", "-ignorewarnings", "-dontobfuscate", "-dontoptimize")

ProguardKeys.options in Proguard += ProguardOptions.keepMain("org.agoravoting.agora.Verifier")
ProguardKeys.options in Proguard += ProguardOptions.keepMain("org.sequent.sequent.Verifier")

ProguardKeys.options in Proguard += ProguardOptions.keepMain("org.agoravoting.agora.Vmnc")
ProguardKeys.options in Proguard += ProguardOptions.keepMain("org.sequent.sequent.Vmnc")

ProguardKeys.options in Proguard += "-keep class vfork.crypto.RandomDevice { *; }"
ProguardKeys.options in Proguard += "-keep class mixnet.crypto.RandomDevice { *; }"

ProguardKeys.options in Proguard += "-keep class vfork.arithm.ModPGroup { *; }"
ProguardKeys.options in Proguard += "-keep class mixnet.arithm.ModPGroup { *; }"

ProguardKeys.options in Proguard += "-keep class vfork.crypto.RandomDeviceGen { *; }"
ProguardKeys.options in Proguard += "-keep class mixnet.crypto.RandomDeviceGen { *; }"

ProguardKeys.options in Proguard += "-keep class * implements com.fasterxml.jackson.databind.cfg.ConfigFeature {*;}"

Expand All @@ -74,7 +74,7 @@ ProguardKeys.options in Proguard += "-keep class scala.concurrent.forkjoin.Linke

ProguardKeys.inputFilter in Proguard := { file =>
file.name match {
case "vfork.jar" => Some("!**/safe_prime_table.txt")
case "mixnet.jar" => Some("!**/safe_prime_table.txt")
case _ => Some("!META-INF/**")
}
}
Loading

0 comments on commit 52b4a0f

Please sign in to comment.