Skip to content

Remove secret-state equality from Sponge in the next breaking release #39

Closed

Description

@HDauven

Follow-up from #38

The pre-existing #[derive(Clone, PartialEq)] on Sponge includes its permutation state and buffered output. Ordinary derived equality provides no constant-time guarantee. Track this as a separate API-hardening and compatibility decision, as suggested in moCello's review.

This is not a confirmed deployed timing leak or authentication bypass: no attacker-observable caller comparing whole sponge instances has been identified. Encryption's authentication check separately uses the backend's Encryption::is_equal contract; removing the derived trait does not replace that obligation.

Proposed scope

  • Check downstream consumers for actual use of Sponge equality.
  • Prefer removing PartialEq in the next breaking release, with a migration/changelog note. Do not silently redefine whole-sponge equality to compare metadata only.
  • If a comparison API is genuinely needed, specify its purpose and constant-time/backend requirements explicitly before adding a replacement.
  • Keep the sponge algorithm, valid encoding and cryptographic outputs unchanged.

Source reviewed: Sponge at bf63c009 and authentication comparison.

Related: #37. This follow-up is intentionally outside #38's merge scope.

Activity

  1. added a commit that references this issue on Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions