Skip to content

Conversation

@chetanyb
Copy link
Contributor

@chetanyb chetanyb commented Jan 9, 2026

Description:

  • Adds an SSZ‑compatible Poseidon2 wrapper under src/ssz/ with a SHA256‑style API.
  • Exports hash_zig.ssz.SszHasher (Poseidon2‑24) and runs Plonky3 parity tests.
  • Documents SSZ integration in the README with a minimal usage example.

NOTE: version bump post‑merge

Copy link
Collaborator

@ch4r10t33r ch4r10t33r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have validated if the cross language tests are working correctly post this change? Please test this for all lifetimes (2^8, 2^18 and 2^32) with number of active epochs as 256/1024.

/// so we buffer until we have enough data.
pub fn update(self: *Self, data: []const u8) void {
// Enforce the 64-byte limit explicitly
std.debug.assert(self.buffer_len + data.len <= BUFFER_SIZE);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in release builds, this will be ignored, which can still lead to uncaught overflow issues. Can we please replace this with runtime checks?

Something like

  if (self.buffer_len + data.len > BUFFER_SIZE) {
      @panic("Input exceeds 64-byte SSZ compression limit");
  }


/// Finalize the hash and write the result to out
pub fn final(self: *Self, out: []u8) void {
std.debug.assert(out.len == 32);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants