Skip to content

Commit 94bef2f

Browse files
apply suggestions
Signed-off-by: eternal-flame-AD <[email protected]>
1 parent bae8e98 commit 94bef2f

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

scrypt/src/block_mix/mod.rs renamed to scrypt/src/block_mix.rs

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
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-
141
cfg_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)]
3628
mod 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

Comments
 (0)