Skip to content

Commit

Permalink
Add support for ext_hashing_keccak_512_version_1 (#231)
Browse files Browse the repository at this point in the history
* Add support for ext_hashing_keccak_512_version_1

* PR link
  • Loading branch information
tomaka authored Feb 27, 2023
1 parent 81820de commit 232d05d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/src/executor/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 4 additions & 0 deletions wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 232d05d

Please sign in to comment.