{"repo":"blockblaz/zig-poseidon","free":true,"listed":false,"github":"https://github.com/blockblaz/zig-poseidon","clone":"git clone https://github.com/blockblaz/zig-poseidon.git","description":"A Zig implementation of Poseidon2 hash function.","language":"Zig","stars":19,"topics":["ethereum","hashing-algorithm","zksnark"],"license":"MIT","category":"blockchain-web3","readme_excerpt":"poseidon A Zig implementation of the Poseidon2 cryptographic hash function. Supported Configurations This implementation provides: Finite Fields - BabyBear field (p = 2³¹ - 2²⁷ + 1 = 0x78000001) - Width: 16 elements - S-Box degree: 7 - Internal rounds: 13 - External rounds: 8 - Use case: Ethereum Lean chain - KoalaBear field (p = 2³¹ - 2²⁴ + 1 = 0x7f000001) - Width: 16 elements - S-Box degree: 3 - Internal rounds: 20 - External rounds: 8 - Use case: plonky3, Rust hash-sig compatibility Features - Generic Montgomery form implementation for finite fields of 31 bits or less - Compression mode (recommended for Merkle Trees) - Both naive and optimized (Montgomery) implementations for verification - Comprehensive test suite ensuring consistency between implementations Installation Add zig-poseidon as a dependency in your build.zig.zon : Get the correct hash: Latest version: See Releases for the most recent version. Usage Using BabyBear16 Using KoalaBear16 (Rust hash-sig compatible) Building and Testing Field Comparison Feature BabyBear KoalaBear --------- ---------- ----------- Prime 2³¹ - 2²⁷ + 1 2³¹ - 2²⁴ + 1 Hex Value 0x78000001 0x7f000001 Width 16 16 S-Box Degree 7 3 Internal Rounds 13 20 External Rounds 8 8 Compatible With Ethereum Lean plonky3, Rust hash-sig Important: Different fields produce completely different hash outputs! Choose the field that matches your target system. Project Motivation This repository was created primarily to support the upcoming Ethereum Lean chain","default_branch":null,"files":null,"tree":[],"storefront":"/r/blockblaz","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/blockblaz/zig-poseidon/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}