Skip to content

A Zig implementation of Poseidon hash function.

License

Notifications You must be signed in to change notification settings

RazorClient/zig-poseidon

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

poseidon

A Zig implementation of the Poseidon2 cryptographic hash function.

Supported Configurations

Currently, this implementation provides:

  • BabyBear finite field with a width of 16 elements
  • Generic Montgomery form implementation for finite fields of 31 bits or less
  • Compression mode, since it's the recommended mode for Merkle Trees compared to the sponge construction.

The generic implementation makes it straightforward to add support for additional 31-bit fields.

Project Motivation

This repository was created primarily to support the upcoming Ethereum Beam chain. The implementation will be updated to match the required configuration once the specifications are finalized.

With time this repository can keep expaning on features:

  • Add support for more finite fields.
  • Add support for the sponge construction.
  • Add benchmarks and optimizations.

Compatibility

This implementation has been cross-validated against the reference repository cited in the Poseidon2 paper to ensure correctness.

License

MIT

About

A Zig implementation of Poseidon hash function.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Zig 100.0%