ref-fvm
ref-fvm copied to clipboard
Perform SHA256 hashes natively via a syscall
HAMTs currently perform SHA256 hashing inside the actors (for hashing HAMT keys). We should be doing this via a syscall.
hash(data: &[u8], mh: Code) ?
Yep. We have the syscall defined here: https://github.com/filecoin-project/ref-fvm/blob/923a6846c203ceaed06dd683ccc4ed37dd738c68/fvm/src/syscalls/crypto.rs#L48
However, we'll have to change the HAMT constructor to take a hash function so that the HAMT will work both inside and outside of the FVM.
Fixed