crypto/EcdhMask hashes with persistentHash directly, and every future module that needs an upgrade-stable hash would do the same, each choosing its own preimage layout and field reduction. There is no place that fixes the hash a scheme uses or lets a consumer swap it.
Add a crypto/hash/ directory with the IHasher contract type (digest and hashToField at T = Bytes<32>) and a Sha256 module behind it. A hash module's mock declares contract implements IHasher, so a drifting signature fails compilation, and a consumer changes hash by changing one import.
crypto/EcdhMaskhashes withpersistentHashdirectly, and every future module that needs an upgrade-stable hash would do the same, each choosing its own preimage layout and field reduction. There is no place that fixes the hash a scheme uses or lets a consumer swap it.Add a
crypto/hash/directory with theIHashercontract type (digestandhashToFieldatT = Bytes<32>) and aSha256module behind it. A hash module's mock declarescontract implements IHasher, so a drifting signature fails compilation, and a consumer changes hash by changing one import.