Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fedejinich/hhego
Hybrid Homomorphic Encryption Scheme written in go
https://github.com/fedejinich/hhego
Last synced: 11 days ago
JSON representation
Hybrid Homomorphic Encryption Scheme written in go
- Host: GitHub
- URL: https://github.com/fedejinich/hhego
- Owner: fedejinich
- Created: 2023-05-09T01:27:46.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-11-23T16:13:14.000Z (about 1 year ago)
- Last Synced: 2023-11-23T17:24:54.701Z (about 1 year ago)
- Language: Go
- Size: 331 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hhego
`hhego` is a monorepo for all Go-based tools used as part of the HHE (Hybrid Homomorphic Encryption) Proof of Concept.
### Components
- **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.
## Installation and Usage
### JNI
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:
```bash
make macos
```The output should be `libbfv_jni.dylib`, a dynamic library for mac.
##### Bash Script
There's also a bash script that builds and copies the output to `rskj`.
```bash
./build_jni_mac.sh
```### JS
The JS component includes a Go script designed to generate encrypted votes for the `fhBallot` project. To execute this script, run:
```bash
go run votes.go
```This script produces a JSON output with the following structure:
```json
{
"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)
}
```##### Bash Script
There's also a bash script that builds and copies the output to `rskj`.
```bash
./generate_votes.sh
```