Skip to content

Commit 4e9925b

Browse files
committed
Fix calculation of cdd statistic
For specific ciphertexts the wrong initialization of a variable would insert undefined state into the internal logic of the 'cdd' statistic. This lead to many thrown (and catched) excpetions, which decreased the performance significantly. An example of such a ciphertext is: 'ooooo' or other sequences of the same letter.
1 parent 7fd66f2 commit 4e9925b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cipherTypeDetection/featureCalculations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@
359359
var i,j,k;
360360
var max,sum;
361361
var index,dif,long_corr,short_corr;
362-
max = 0;
362+
max = -1;
363363
364364
for (j= col;j<key_len;j++) {
365365
long_corr = short_corr = 0;

0 commit comments

Comments
 (0)