zkpop-go
is a Go wrapper around the libzkpop
library from the
KEM-NIZKPoP
project. It provides functions to generate keypairs, create Zero-Knowledge
Proofs of Possession (ZKPoP), and verify proofs.
Ensure you have the following installed on your system:
- GCC with AVX2, AES, and BMI2 support.
- OpenSSL development libraries:
sudo apt install libssl-dev
- Go programming language (version 1.15+ recommended).
- CMake for building the external library.
First, clone the zkpop-go
repository:
git clone --recurse-submodules https://github.com/gabrielzschmitz/zkpop-go.git
cd zkpop-go
If you have already cloned the repository without submodules, you can initialize and update them using:
git submodule update --init --recursive
The Go wrapper depends on the libzkpop.a
static library, which needs to be
built from the KEM-NIZKPoP project.
To build the library:
- Navigate to the project root directory:
cd zkpop-go
- Run the following commands to create the build directory, configure the build, and compile the library:
mkdir build cd build cmake .. make
This will generate libzkpop.a
inside build/lib/
.
Once the library is built, you can compile the Go project and link it to the
required libraries (OpenSSL and libzkpop.a
):
CGO_CFLAGS="-mavx2 -maes -mbmi2 -O3 -I/usr/include/openssl" \
CGO_LDFLAGS="-L/usr/lib/x86_64-linux-gnu -lssl -lcrypto" \
go build -o zkpop
After building, you can run the main test file (main.go
) to verify the
implementation:
./zkpop
- Ensure you have the appropriate AVX2, AES, and BMI2 support on your system’s CPU.
- Modify the OpenSSL paths in
CGO_CFLAGS
andCGO_LDFLAGS
if your installation differs. - The compilation still not fully complete and need further investigation to include all necessary dependencies!
This project is licensed under the MIT License.