Poseidon is a Zero-Knowledge-Proof friendly hash function widely used in ZK applications. Compared with other hash function commonly used in crypto space, Poseidon will incur less circuit constraints while preserving security presumptions.
This repository provides examples to access iden3 poseidon implementation over BN254 in other platforms through C shared libraries, following cgo examples.
- Golang 1.20
- Clone this repository to your local machine.
cd src
sh build-so.sh
- You can find the dynamic library
poseidon.so
and header fileposeidon.h
underoutput/
folder. - Alternatively, prebuilt binaries for common platforms are available in the binaries/ folder of the repository.
Check out example to use the shared library under examples/c
sh build-and-run.sh
- By default, it is linked to binary under binaries/macos-arm64/
- As indicated by the example, C program is responsible to manage the memory of input arguments and output result.