diff --git a/tools/test.sh b/tools/test.sh index 91e9fc653..04fcfbdad 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -32,7 +32,7 @@ HASH_TYPES="0 10 11 12 20 21 22 23 30 40 50 60\ 16200 16300 16400 16500 16600 16700 16800 16900 17300 17400 17500 17600 17700\ 17800 17900 18000 18100 18200 18300 18400 18500 18600 99999" -HASH_TYPES="0 10 11 12 20 21 23 50 60 100 110 120 200 1000 1500 5600 18400 18500 18600" +HASH_TYPES="0 10 11 12 20 21 23 50 60 100 110 120 200 300 1000 1500 5600 18400 18500 18600" VECTOR_WIDTHS="1 2 4 8 16" diff --git a/tools/test_modules/m00300.pm b/tools/test_modules/m00300.pm new file mode 100644 index 000000000..e33b71597 --- /dev/null +++ b/tools/test_modules/m00300.pm @@ -0,0 +1,42 @@ +#!/usr/bin/env perl + +## +## Author......: See docs/credits.txt +## License.....: MIT +## + +use strict; +use warnings; + +use Crypt::MySQL qw (password41); + +sub module_constraints { [[0, 256], [0, 0], [0, 55], [0, 0], [-1, -1]] } + +sub module_generate_hash +{ + my $word = shift; + + my $digest = lc (substr (password41 ($word), 1)); + + my $hash = sprintf ("%s", $digest); + + return $hash; +} + +sub module_verify_hash +{ + my $line = shift; + + my ($hash, $word) = split (':', $line); + + return unless defined $hash; + return unless defined $word; + + my $word_packed = pack_if_HEX_notation ($word); + + my $new_hash = module_generate_hash ($word_packed); + + return ($new_hash, $word); +} + +1;