hhego
is a monorepo for all Go-based tools used as part of the HHE (Hybrid Homomorphic Encryption) Proof of Concept.
- bfv:
lattigo
wrapper, designed to create hybrid homomorphic encryption schemes. - pasta: contains PASTA symmetric cipher.
- js: A script for generating votes in the
fhBallot
project. - jni: Java bindings to integrate it with
rskj
. - workspace: a place for small tests.
The goal of hhego
is to integrate these components with rskj
, enabling support for hybrid homomorphic encryption on Rootstock.
The JNI component enables the use of bfv
in Java applications, in this PoC we use it to integrate it with rskj
and use it as a precompiled contract.
To build this library, use the following command:
make macos
The output should be libbfv_jni.dylib
, a dynamic library for mac.
There's also a bash script that builds and copies the output to rskj
.
./build_jni_mac.sh
The JS component includes a Go script designed to generate encrypted votes for the fhBallot
project. To execute this script, run:
go run votes.go
This script produces a JSON output with the following structure:
{
"votes": [[1, 0, 0, 0], [0, 1, 0, 0]], // Generated votes
"votesPasta": [[30447, 62405, 62714, 38763], [30446, 62406, 62714, 38763]], // Encrypted votes using PASTA
"pastaSK": [1, 1, 1, 1, 1], // BFV-encrypted PASTA secret key
"rk": [1, 1, 1, 1, 1], // Relinearization key (for converting PASTA votes to BFV votes)
"bfvSK": [1, 1, 1, 1, 1] // BFV secret key (used for encrypting PASTA SK)
}
There's also a bash script that builds and copies the output to rskj
.
./generate_votes.sh