From 3ebb2ce1638930edff8507a10f854866035f1b08 Mon Sep 17 00:00:00 2001 From: philsmd Date: Tue, 21 Jul 2020 11:28:59 +0200 Subject: [PATCH] tests: fixed -m 13200 = AxCrypt tests --- docs/changes.txt | 1 + tools/test_modules/m13200.pm | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 14b6c9097..d8d816f1d 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -31,6 +31,7 @@ - Backend: Changed the maximum number of compute devices from 64 to 128 - Tests: Improved tests for hash-mode 11300 (Bitcoin/Litecoin wallet.dat) +- Tests: Improved tests for hash-mode 13200 (AxCrypt) - Tests: Improved tests for hash-mode 13600 (WinZip) - Tests: Improved tests for hash-mode 16800 (WPA-PMKID-PBKDF2) diff --git a/tools/test_modules/m13200.pm b/tools/test_modules/m13200.pm index d271e375c..c357faf3e 100644 --- a/tools/test_modules/m13200.pm +++ b/tools/test_modules/m13200.pm @@ -51,7 +51,7 @@ sub module_generate_hash $KEK = substr ($KEK ^ $mysalt, 0, 16); - my $aes = Crypt::Mode::ECB->new ('AES'); + my $aes = Crypt::Mode::ECB->new ('AES', 0); my $B; @@ -75,7 +75,7 @@ sub module_generate_hash $B = $R[2]; - $A = $aes->decrypt ($A . $B . "\x00" x 16, $KEK); + $A = $aes->decrypt (substr ($A . $B . "\x00" x 16, 0, 16), $KEK); $R[2] = substr ($A, 8, 16); @@ -83,7 +83,7 @@ sub module_generate_hash $B = $R[1]; - $A = $aes->decrypt ($A . $B . "\x00" x 16, $KEK); + $A = $aes->decrypt (substr ($A . $B . "\x00" x 16, 0, 16), $KEK); $R[1] = substr ($A, 8, 16); } @@ -109,13 +109,13 @@ sub module_generate_hash for (my $j = 0; $j < $iteration; $j++) { - $B = $aes->encrypt ($A . $R[1], $KEK); + $B = $aes->encrypt (substr ($A . $R[1] . "\x00" x 16, 0, 16), $KEK); $A = substr ($B, 0, 8) ^ pack ("q", (2 * $j + 1)); $R[1] = substr ($B, 8, 16); - $B = $aes->encrypt ($A . $R[2], $KEK); + $B = $aes->encrypt (substr ($A . $R[2] . "\x00" x 16, 0, 16), $KEK); $A = substr ($B, 0, 8) ^ pack ("q", (2 * $j + 2));