...
代码块 |
---|
running 4 tests test rust_crypto_sha3_256_input_32_bytes ... bench: 441 ns/iter (+/- 47) = 72 MB/s test rust_crypto_sha3_256_input_4096_bytes ... bench: 12,875 ns/iter (+/- 775) = 318 MB/s test tiny_keccak_sha3_256_input_32_bytes ... bench: 452 ns/iter (+/- 23) = 70 MB/s test tiny_keccak_sha3_256_input_4096_bytes ... bench: 13,073 ns/iter (+/- 880) = 313 MB/s |
目前看起来crypto hash效率慢慢赶上来了,可能会超过tiny-kecccak,前者一直在开发维护,后者两年都没有更新了
目前有一份从XKCP的C实现 ffi 给rust调用的实现
https://github.com/starcoinorg/starcoin-crypto/tree/main/crates/diem-crypto/ext