diff --git a/src/formats.c b/src/formats.c index 6af9913..826bbb5 100644 --- a/src/formats.c +++ b/src/formats.c @@ -97,6 +97,8 @@ char *fmt_self_test(struct fmt_main *format) return "salt_hash"; format->methods.set_salt(salt); + if (index == 0) + format->methods.clear_keys(); format->methods.set_key(current->plaintext, index); format->methods.crypt_all(index + 1); @@ -139,7 +141,6 @@ char *fmt_self_test(struct fmt_main *format) if (index >= max) { index = (max > 5 && max > ntests && done != 1) ? 5 : 0; done |= 1; - format->methods.clear_keys(); } if (!(++current)->ciphertext) { @@ -152,7 +153,6 @@ char *fmt_self_test(struct fmt_main *format) current = format->params.tests; done |= 2; - format->methods.clear_keys(); } } while (done != 3);