Repository navigation
Remove secret-state equality from Sponge - #40
Merged
Merged
Conversation
Remove derived PartialEq while retaining Clone and the separate backend authentication contract. Drop the otherwise-unused stored domain separator; initialization still binds the separator into the tag. Document migration away from whole-sponge comparisons and guard the API with a compile-fail doctest. Fixes #39
Neotamandua
approved these changes
Sep 12, 2026
This was referenced Sep 12, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PartialEqfromSponge, retainingClone, so the API no longer exposes ordinary whole-state equality over secret state and buffered output.domain_sepfield, which becomes unused without derived equality. The constructor still includes the domain separator in the initial tag.Fixes #39.
Compatibility
Breaking Rust API change for the next breaking release. Remove whole-sponge comparisons and
Sponge: PartialEqrequirements when upgrading; no replacement comparison API is introduced. This PR does not bump the package version.Sponge state width, arithmetic, pattern encoding, field-based zeroization and backend authentication through
Encryption::is_equalare unchanged. The inspected Poseidon callers keep sponges local and return outputs rather than exposing a serialized or FFI sponge layout. This is API hardening, not a claim of a demonstrated deployed timing leak.Validation
Rust 1.96.1, final source, local checks:
make test: 20 debug + 20 release test executions; existing zeroize 1.5.4 consumer check passes.make cq, documentation, and bare-metal builds with/without encryption pass.PartialEqto the final source makes the new doctest fail because the supposedly non-compiling comparison compiles successfully.Only two files ship; benchmark and investigation scaffolding remains local. No contract source, WASM, dependency or CI change is included.