diff --git a/tools/test.pl b/tools/test.pl index 8d294d61c..2ea8b094d 100755 --- a/tools/test.pl +++ b/tools/test.pl @@ -13,10 +13,6 @@ use File::Basename; use FindBin; use List::Util 'shuffle'; -# used by hash-mode 31500 and 31600 -use Text::Iconv; -use Digest::MD4 qw (md4_hex); - # allows require by filename use lib "$FindBin::Bin/test_modules"; @@ -163,13 +159,6 @@ sub single { for my $salt (sort { length $a <=> length $b } keys %{$db_prev->{$word}}) { - if ($MODE == 31500 || $MODE == 31600) - { - my $converter = Text::Iconv->new('utf8', 'UTF-16LE'); - - $word = md4_hex ($converter->convert ($word)); - } - my $hash = module_generate_hash ($word, $salt); # possible if the requested length is not supported by algorithm @@ -240,13 +229,6 @@ sub passthrough $idx++; - if ($MODE == 31500 || $MODE == 31600) - { - my $converter = Text::Iconv->new('utf8', 'UTF-16LE'); - - $word = md4_hex ($converter->convert ($word)); - } - my $hash = module_generate_hash ($word, $salt); next unless defined $hash; diff --git a/tools/test_modules/m31500.pm b/tools/test_modules/m31500.pm index d1efbf4c3..aad5eb32a 100644 --- a/tools/test_modules/m31500.pm +++ b/tools/test_modules/m31500.pm @@ -9,10 +9,22 @@ use strict; use warnings; use Digest::MD4 qw (md4_hex); +use Text::Iconv; use Encode; sub module_constraints { [[32, 32], [0, 256], [-1, -1], [-1, -1], [-1, -1]] } +sub module_get_random_password +{ + my $word = shift; + + my $converter = Text::Iconv->new('utf8', 'UTF-16LE'); + + $word = md4_hex ($converter->convert ($word)); + + return $word; +} + sub module_generate_hash { my $word = shift; diff --git a/tools/test_modules/m31600.pm b/tools/test_modules/m31600.pm index aa7fcf99d..ced57691d 100644 --- a/tools/test_modules/m31600.pm +++ b/tools/test_modules/m31600.pm @@ -10,10 +10,22 @@ use warnings; use Digest::MD4 qw (md4); use Crypt::PBKDF2; +use Text::Iconv; use Encode; sub module_constraints { [[32, 32], [0, 256], [-1, -1], [-1, -1], [-1, -1]] } +sub module_get_random_password +{ + my $word = shift; + + my $converter = Text::Iconv->new('utf8', 'UTF-16LE'); + + $word = md4_hex ($converter->convert ($word)); + + return $word; +} + sub module_generate_hash { my $word = shift;