Stream: git-wasmtime

Topic: wasmtime / PR #3619 Use SipHasher rather than SHA-512 for...


view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2021 at 20:02):

cfallin opened PR #3619 from isle-manifest-siphash to main:

Fixes #3609. It turns out that sha2 is a nontrivial dependency for
Cranelift in many contexts, partly because it pulls in a number of other
crates as well.

One option is to remove the hash check under certain circumstances, as
implemented in #3616. However, this is undesirable for other reasons:
having different dependency options in Wasmtime in particular for
crates.io vs. local builds is not really possible, and so either we
still have the higher build cost in Wasmtime, or we turn off the checks
by default, which goes against the original intent of ensuring developer
safety (no mysterious stale-source bugs).

This PR uses SipHash instead, which is built into the standard
library. SipHash is deprecated, but it's fixed and deterministic
(across runs and across Rust versions), which is what we need, unlike
the suggested replacement std::collections::hash_map::DefaultHasher.
The result is only 64 bits, and is not cryptographically secure, but we
never needed that; we just need a simple check to indicate when we
forget a rebuild-isle.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2021 at 20:02):

cfallin requested alexcrichton for a review on PR #3619.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2021 at 20:04):

bjorn3 submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2021 at 20:08):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2021 at 20:08):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2021 at 20:08):

alexcrichton created PR review comment:

Could this be moved to the compute_manifest function to localize the allow-deprecated-things to a smaller scope? (moving the import of SipHasher down there too)

view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2021 at 20:11):

cfallin updated PR #3619 from isle-manifest-siphash to main.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2021 at 20:11):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2021 at 20:11):

cfallin created PR review comment:

Done!

view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2021 at 21:15):

cfallin merged PR #3619.


Last updated: Oct 23 2024 at 20:03 UTC