snarkVM icon indicating copy to clipboard operation
snarkVM copied to clipboard

Hashes - ARC-81

Open anstylian opened this issue 11 months ago • 2 comments

Motivation

This pull request introduces changes to the Hash instructions in the synthesizer/program/src/logic/instruction/operation/hash.rs file. The main focus is on improving the handling of destination types and adding support for additional array types in hashing operations (sha3 and keccak).

It is a step forward for the implementation of ARC-81.

Test Plan

Let me know how you prefer to test this

anstylian avatar Jan 09 '25 16:01 anstylian

Thanks @anstylian for taking an attempt at ARC-81! I think this approach will need careful consideration before we move forward. Specifically we'd like to:

  • Ensure the approach is consistent in design. In particular, I'd like to be certain that the bespoke variants don't create confusion for users and tech debt in the future.
  • Ensure the circuits are sufficiently constrained.
  • Thoroughly test the implementation. One property that needs testing is that the output arrays are correctly constructed. I imagine there are more.

d0cd avatar Jan 18 '25 14:01 d0cd

@d0cd, do you have any suggestions for testing?

  1. Should we consider adding the result of the hash in arrays of u128?
  2. Should we consider a specific type for hash results?

anstylian avatar Feb 05 '25 11:02 anstylian