diff --git a/lib/src/executor/host.rs b/lib/src/executor/host.rs index f2d3c66e9d..7d147b774c 100644 --- a/lib/src/executor/host.rs +++ b/lib/src/executor/host.rs @@ -1835,7 +1835,15 @@ impl ReadyToRun { self.inner .alloc_write_and_return_pointer(host_fn.name(), iter::once(&out)) } - HostFunction::ext_hashing_keccak_512_version_1 => host_fn_not_implemented!(), + HostFunction::ext_hashing_keccak_512_version_1 => { + let mut keccak = tiny_keccak::Keccak::v512(); + keccak.update(expect_pointer_size!(0).as_ref()); + let mut out = [0u8; 64]; + keccak.finalize(&mut out); + + self.inner + .alloc_write_and_return_pointer(host_fn.name(), iter::once(&out)) + } HostFunction::ext_hashing_sha2_256_version_1 => { let mut hasher = sha2::Sha256::new(); hasher.update(expect_pointer_size!(0)); diff --git a/wasm-node/CHANGELOG.md b/wasm-node/CHANGELOG.md index d65197260e..2c24a17df7 100644 --- a/wasm-node/CHANGELOG.md +++ b/wasm-node/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +## Added + +- Add support for the `ext_hashing_keccak_512_version_1` host function. ([#231](https://github.com/smol-dot/smoldot/pull/231)) + ## Fixed - Fix panic when the input data of a Wasm function call is larger than a Wasm page. ([#218](https://github.com/smol-dot/smoldot/pull/218))