Skip to content

[CT-90] No test for a cache-key collision between SHA-256 and SHA-512 anchors of related content #1214

Description

@mftee

Overview

SC-07 added SHA-512 anchoring alongside the original SHA-256 support, but contract/src/cache.rs's cache-key construction should be confirmed to namespace by hash algorithm — otherwise a SHA-256 hash and an unrelated SHA-512 hash that happen to share a prefix/value space could collide in the cache and return the wrong verification result.

Tasks

  • Confirm (or add) the hash algorithm as part of the cache key, not just the hash value
  • Add a test asserting a SHA-256 and a SHA-512 entry with a contrived overlapping key component don't collide

Acceptance Criteria

  • Cache keys are namespaced by hash algorithm, verified by a dedicated test

Notes for Contributors

Comment below to be assigned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcontract

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions