1- #[ cfg( any(
2- test,
3- not( any(
4- all(
5- any( target_arch = "x86" , target_arch = "x86_64" ) ,
6- target_feature = "sse2"
7- ) ,
8- all( target_arch = "aarch64" , target_feature = "neon" ) ,
9- all( target_arch = "wasm32" , target_feature = "simd128" ) ,
10- ) )
11- ) ) ]
12- mod soft;
13-
141cfg_if:: cfg_if! {
152 if #[ cfg( all( target_arch = "aarch64" , target_feature = "neon" ) ) ] {
163 mod pivot;
@@ -25,13 +12,18 @@ cfg_if::cfg_if! {
2512 mod sse2;
2613 pub ( crate ) use sse2:: { scrypt_block_mix, shuffle_in, shuffle_out} ;
2714 } else {
15+ mod soft;
2816 pub ( crate ) use soft:: scrypt_block_mix;
2917
3018 pub ( crate ) fn shuffle_in( _input: & mut [ u8 ] ) { }
3119 pub ( crate ) fn shuffle_out( _input: & mut [ u8 ] ) { }
3220 }
3321}
3422
23+ #[ cfg( test) ]
24+ #[ path = "block_mix/soft.rs" ]
25+ mod soft_test;
26+
3527#[ cfg( test) ]
3628mod tests {
3729 use super :: * ;
@@ -44,11 +36,11 @@ mod tests {
4436
4537 let mut expected0 = [ 0u8 ; 128 ] ;
4638 let mut expected1 = [ 0u8 ; 128 ] ; // check shuffle_out is a correct inverse of shuffle_in
47- soft :: scrypt_block_mix ( & input, & mut expected0) ;
39+ soft_test :: scrypt_block_mix ( & input, & mut expected0) ;
4840 shuffle_in ( & mut input) ;
4941 scrypt_block_mix ( & input, & mut output) ;
5042 shuffle_out ( & mut input) ;
51- soft :: scrypt_block_mix ( & input, & mut expected1) ;
43+ soft_test :: scrypt_block_mix ( & input, & mut expected1) ;
5244 shuffle_out ( & mut output) ;
5345 assert_eq ! (
5446 expected0, expected1,
0 commit comments