File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
crates/primitives/src/utils Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ paste = "1.0"
7171
7272# crypto
7373k256 = { version = " 0.13" , default-features = false }
74- keccak-asm = { version = " 0.1.0 " , default-features = false }
74+ keccak-asm = { version = " 0.1.5 " , default-features = false }
7575tiny-keccak = { version = " 2.0" , default-features = false }
7676sha3 = { version = " 0.10.8" , default-features = false , features = [" asm" ] }
7777
Original file line number Diff line number Diff line change @@ -176,6 +176,7 @@ pub fn keccak256_uncached<T: AsRef<[u8]>>(bytes: T) -> B256 {
176176 keccak256_impl ( bytes. as_ref ( ) )
177177}
178178
179+ #[ allow( unused) ]
179180fn keccak256_impl ( bytes : & [ u8 ] ) -> B256 {
180181 let mut output = MaybeUninit :: < B256 > :: uninit ( ) ;
181182
@@ -203,6 +204,8 @@ fn keccak256_impl(bytes: &[u8]) -> B256 {
203204
204205 // SAFETY: The output is 32-bytes, and the input comes from a slice.
205206 unsafe { native_keccak256( bytes. as_ptr( ) , bytes. len( ) , output. as_mut_ptr( ) . cast:: <u8 >( ) ) } ;
207+ } else if #[ cfg( all( feature = "asm-keccak" , not( miri) ) ) ] {
208+ return B256 :: new( keccak_asm:: Keccak256 :: digest( bytes) . into( ) ) ;
206209 } else {
207210 let mut hasher = Keccak256 :: new( ) ;
208211 hasher. update( bytes) ;
You can’t perform that action at this time.
0 commit comments