ref-fvm icon indicating copy to clipboard operation
ref-fvm copied to clipboard

Perform SHA256 hashes natively via a syscall

Open Stebalien opened this issue 3 years ago • 2 comments

HAMTs currently perform SHA256 hashing inside the actors (for hashing HAMT keys). We should be doing this via a syscall.

Stebalien avatar Jun 24 '22 17:06 Stebalien

hash(data: &[u8], mh: Code) ?

mriise avatar Jun 24 '22 18:06 mriise

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.

Stebalien avatar Jun 24 '22 18:06 Stebalien

Fixed

Stebalien avatar Oct 07 '22 15:10 Stebalien