You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
85
+
pub fn main() !void {
86
+
const Field = koalabear16.Poseidon2KoalaBear.Field;
87
+
88
+
// Prepare input state (16 field elements)
89
+
var input_state: [16]u32 = .{0} ** 16;
90
+
input_state[0] = 42;
91
+
92
+
// Convert to Montgomery form
93
+
var mont_state: [16]Field.MontFieldElem = undefined;
**Important:** Different fields produce completely different hash outputs! Choose the field that matches your target system.
134
+
135
+
## Project Motivation
136
+
137
+
This repository was created primarily to support the upcoming Ethereum Lean chain. The KoalaBear field was added to enable compatibility with Rust's hash-sig implementation and plonky3.
24
138
25
139
## Compatibility
26
140
27
-
This implementation has been cross-validated against the [reference repository](https://github.com/HorizenLabs/poseidon2) cited in the Poseidon2 paper to ensure correctness.
141
+
-**BabyBear**: Cross-validated against the [Poseidon2 reference repository](https://github.com/HorizenLabs/poseidon2)
142
+
-**KoalaBear**: Compatible with [plonky3](https://github.com/Plonky3/Plonky3) and [Rust hash-sig](https://github.com/b-wagn/hash-sig)
143
+
144
+
Both implementations include tests ensuring the naive and optimized (Montgomery) implementations produce identical outputs.
0 commit comments