-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
- Loading branch information
Showing
2 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,26 @@ | ||
# poseidon | ||
A Zig implementation of Poseidon hash function | ||
|
||
A Zig implementation of the Poseidon hash function, using the [Neptune optimizations](https://github.com/lurk-lab/neptune/blob/ef14a61b1aa7f8e92e6ace2190723c155e613a4a/spec/poseidon_spec.pdf). | ||
|
||
## Supported finite fields | ||
|
||
This implementation is currently targeting BN254 scalar field (i.e: BabyJubJub base field), to be compatible with: | ||
- [CircomLib](https://github.com/iden3/circomlib) repository. | ||
- [go-iden3-crypto](https://github.com/iden3/go-iden3-crypto/tree/master/poseidon) implementation. | ||
- [poseidon-rs](https://github.com/arnaucube/poseidon-rs) implementation. | ||
|
||
The parameters for BN254 were [pulled from CircomLib](https://github.com/iden3/circomlibjs/blob/4f094c5be05c1f0210924a3ab204d8fd8da69f49/src/poseidon_constants.json) which can be generated with the [official Sage script](https://extgit.iaik.tugraz.at/krypto/hadeshash) and transformed using a [CircomLibJS tool](https://github.com/iden3/circomlibjs/blob/main/tools/poseidon_optimize_constants.js) created by @jbaylina. | ||
|
||
Supporting other fields (e.g: BLS12-381 scalar field) would only involve generating the parameters. | ||
|
||
## Benchmarks | ||
|
||
To be included soon. | ||
|
||
## Future work | ||
|
||
Due to some limitations of JSON at `comptime`, the parameter parsing is dynamic for now. Whenever this gets fixed, we can avoid this (init) runtime overhead and strip down the binary size. | ||
|
||
## License | ||
|
||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters