@@ -19,6 +19,7 @@ public static IEnumerable<object[]> GetProcessCases()
19
19
2 ,
20
20
true , string . Empty ,
21
21
Helper . HexToBytes ( "9ca0271b64c0e66f" ) ,
22
+ Helper . HexToBytes ( "0032153d50cbf924a2ac1dc5f6279436" ) ,
22
23
Helper . HexToBytes ( "55f5e848d66586747cc000826d4c0c35" ) ,
23
24
327366
24
25
} ;
@@ -27,55 +28,56 @@ public static IEnumerable<object[]> GetProcessCases()
27
28
"43000130ac71182a748152bb788fb9deb11f2f5a55f5e848d66586747cc000826d4c0c350032153d50cbf924a2ac1dc5f6279436089ca0271b64c0e66f00000000c6fe040000" ,
28
29
0 ,
29
30
false , "Password length must be at least 1." ,
30
- null , null , 0
31
+ null , null , null , 0
31
32
} ;
32
33
yield return new object [ ]
33
34
{
34
35
"43000130ac71182a748152bb788fb9deb11f2f5a55f5e848d66586747cc000826d4c0c350032153d50cbf924a2ac1dc5f6279436089ca0271b64c0e66f00000000c6fe040000" ,
35
36
- 1 ,
36
37
false , "Password length must be at least 1." ,
37
- null , null , 0
38
+ null , null , null , 0
38
39
} ;
39
40
yield return new object [ ]
40
41
{
41
42
null ,
42
43
2 ,
43
44
false , "Input hex can not be null or empty." ,
44
- null , null , 0
45
+ null , null , null , 0
45
46
} ;
46
47
yield return new object [ ]
47
48
{
48
49
"abcx" ,
49
50
2 ,
50
51
false , "Invalid character \" x\" found at index=3." ,
51
- null , null , 0
52
+ null , null , null , 0
52
53
} ;
53
54
yield return new object [ ]
54
55
{
55
56
"abc" ,
56
57
2 ,
57
58
false , "Invalid hex string." ,
58
- null , null , 0
59
+ null , null , null , 0
59
60
} ;
60
61
yield return new object [ ]
61
62
{
62
63
"abcd" ,
63
64
2 ,
64
65
false , "Input hex is expected to be at least 70 bytes but it is 2 bytes." ,
65
- null , null , 0
66
+ null , null , null , 0
66
67
} ;
67
68
yield return new object [ ]
68
69
{
69
70
Helper . GetBytesHex ( 70 ) ,
70
71
2 ,
71
72
false , "Could not find 0x43000130 in the given hex." ,
72
- null , null , 0
73
+ null , null , null , 0
73
74
} ;
74
75
}
75
76
76
77
[ Theory ]
77
78
[ MemberData ( nameof ( GetProcessCases ) ) ]
78
- public void ProcessTest ( string hex , int passLength , bool expected , string expError , byte [ ] expSalt , byte [ ] expXor , int expIter )
79
+ public void ProcessTest ( string hex , int passLength , bool expected , string expError ,
80
+ byte [ ] expSalt , byte [ ] expEncrypted , byte [ ] expXor , int expIter )
79
81
{
80
82
CorePassSearchSpace searchSpace = new ( ) ;
81
83
bool actual = searchSpace . Process ( hex , passLength , out string error ) ;
@@ -87,6 +89,7 @@ public void ProcessTest(string hex, int passLength, bool expected, string expErr
87
89
{
88
90
Assert . Equal ( searchSpace . PasswordLength , passLength ) ;
89
91
Assert . Equal ( searchSpace . Salt , expSalt ) ;
92
+ Assert . Equal ( searchSpace . Encrypted , expEncrypted ) ;
90
93
Assert . Equal ( searchSpace . XOR , expXor ) ;
91
94
Assert . Equal ( searchSpace . Iteration , expIter ) ;
92
95
}
0 commit comments