Open paulcadman opened 2 months ago
Depends on:
This issue proposes adding a builtin SHA-256 function.
--- SHA-256 hash ;Bytes; into a digest ;Bytes; (32 bytes). builtin axiom sha256hash : Bytes -> Bytes
This is required because several fields in an Anoma resource (logic function, commitments etc.) will be hashes rather than the original plaintext.
We can use a Haskell library, e.g cryptohash-sha256 to implement the builtin.
We can use the same implementation as Core in the Juvix Nockma evaluator.
We will need an SHA-256 hash implementation in the Anoma Hoon stdlib in order to run programs containing this builtin in the Anoma Nock VM.
The implementation of sha256hash for the native, Cairo and Risc0 backends is deferred.
sha256hash
Depends on:
This issue proposes adding a builtin SHA-256 function.
This is required because several fields in an Anoma resource (logic function, commitments etc.) will be hashes rather than the original plaintext.
Backend Representation
Core
We can use a Haskell library, e.g cryptohash-sha256 to implement the builtin.
Nockma
We can use the same implementation as Core in the Juvix Nockma evaluator.
We will need an SHA-256 hash implementation in the Anoma Hoon stdlib in order to run programs containing this builtin in the Anoma Nock VM.
Native, Cairo, Risc0
The implementation of
sha256hash
for the native, Cairo and Risc0 backends is deferred.