-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Faster alternative to BLAKE2bp #282
Comments
How/where do you recommend we store the secret seed? |
Is the cache directory something guest webassembly modules are supposed to ever have access to? In this context, simply storing the key as a file with a fixed name in the cache directory should be acceptable. |
The last versions have AVX2 support, and should be about 5x faster than BLAKE2bp on Nehalem. |
Thanks for the suggestion. It seems to be a solid candidate! |
We've started using wasmer here at Embark and for our game runtime use cases I would be hesitant of any hashes (or other code) that use AVX2. Because using those instructions unfortunately slows down the rest of the CPU so often is an overall net loss in performance due to frequency throttling. Could be available as an option though if one already is running with AVX2/512 and is throttled. Or simply wants the fastest possible hashing for a use case. |
The current code already heavily depends on AVX2. And STHash is faster than the current hash even without vectorization. AVX512 quickly gets CPUs to reduce their frequency. Throttling due to AVX2 is more reasonable, but more importantly, STHash only uses AVX2 (if available) for very short amounts of time. NH evaluations alternate with Poly1305 evaluations that don't use vector extensions. On a 8 cores Core i7, I couldn't get the CPU to throttle during STHash benchmarks, so this is unlikely to happen on Xeons either. |
We just started using Closing the issue :) |
Something for you:
https://docs.rs/sthash - https://github.com/jedisct1/rust-sthash
Note that you will need to generate and store a secret seed (once for the whole cache). This is critical in order to protect against forgery, especially with large files.
The text was updated successfully, but these errors were encountered: