This is a fork from https://github.com/votingworks/electionguard-kotlin-multiplatform aiming to provide a kotlin/js implementation for ballot encryption in order to be used in a web environment.
Therefore, we split the project in the following modules targeting different platforms:
Module | JVM | JS Node | JS Browser |
---|---|---|---|
egklib-core | ✅ | ✅ | ✅ |
egklib-trustee | ✅ | ✅ | ✅ |
egklib-encrypt | ✅ | ✅ | ✅ |
egklib | ✅ | ✅ | ❌ |
egk-cli | ✅ | ❌ | ❌ |
- Using the big-integer module as a replacement for
java.math.BigInteger
- Getting randomness from
window.crypto
ornode:crypto.webcrypto
instead ofjava.security.SecureRandom
- Using @noble/hashes for
sha256
andhmac
. - For IO operations, we are using
kotlin-node
from the kotlin-wrappers project. - Amend signature of
hashFunction
andhmacFunction
to address platform differences regarding number types. - Parallelized and thread-safe implementations are ported to the JS platform by only considering single-threaded execution.
- Provide readline functionality in the
egk-cli
module for the JS Node platform. - Investigate performance deficits on node and browser platforms.
last update 01/21/2024
ElectionGuard-Kotlin-Multiplatform (EGK) is a Kotlin Multiplatform implementation of ElectionGuard, version 2.0.0, available under an MIT-style open source License.
Our GitHub repository is now hosted by VotingWorks.
Currently we have ~88% LOC code coverage on the common and jvm core library (7024/7995 LOC). We are focusing on just the JVM implementation, and will consider native and other implementations in the future.
Library dependencies are summarized here.
Currently Java 17 is required.
Table of contents:
We are waiting for the 2.0 JSON serialization specification from Microsoft, before finalizing our serialization. For now, we are still mostly using the 1.9 serialization.
Support for Protocol Buffers has been moved to this repo.
These are JSON files that give inputs and expected outputs for the purpose of testing interoperability between implementations.