mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-14 06:35:40 +00:00
Use blake2b SIMD version for increased performance
This commit is contained in:
parent
2d49d58665
commit
e6d0f91832
@ -2,7 +2,7 @@ use crate::{
|
|||||||
module::{Module, ModuleInfo},
|
module::{Module, ModuleInfo},
|
||||||
sys::Memory,
|
sys::Memory,
|
||||||
};
|
};
|
||||||
use blake2b_simd::blake2b;
|
use blake2b_simd::blake2bp;
|
||||||
use std::{fmt, io, mem, slice};
|
use std::{fmt, io, mem, slice};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@ -45,7 +45,10 @@ impl WasmHash {
|
|||||||
let mut first_part = [0u8; 32];
|
let mut first_part = [0u8; 32];
|
||||||
let mut second_part = [0u8; 32];
|
let mut second_part = [0u8; 32];
|
||||||
|
|
||||||
let mut hasher = blake2b(wasm);
|
let mut state = blake2bp::State::new();
|
||||||
|
state.update(wasm);
|
||||||
|
|
||||||
|
let mut hasher = state.finalize();
|
||||||
let generic_array = hasher.as_bytes();
|
let generic_array = hasher.as_bytes();
|
||||||
|
|
||||||
first_part.copy_from_slice(&generic_array[0..32]);
|
first_part.copy_from_slice(&generic_array[0..32]);
|
||||||
|
Loading…
Reference in New Issue
Block a user