OpenZeppelin / OpenZeppelin/compact-contracts
dev: add a crypto/hash interface with a SHA-256 module
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 55
- Forks
- 29
- Avg merge
- 5d 7h
- Merged PRs (30d)
- 25
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading crypto/EcdhMask to understand the existing persistentHash usage, then inspect the surrounding crypto modules and project conventions. Add the crypto/hash/ contract and SHA-256 module with the stated IHasher methods and mock implementation; done means consumers can swap the hash through one import and the contracts compile.
Written by the indexing model from the issue text.
Assessment
- Domain
- cryptography
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100