update efficient rain option

This commit is contained in:
owein D 2020-09-29 21:01:13 +02:00 committed by yvain douard
commit 74ef9c594d
2 changed files with 11 additions and 0 deletions

7
bfg.c
View file

@ -220,6 +220,13 @@ char *bf_next() {
printf(", x: %s\n", bf_options.ptr); printf(", x: %s\n", bf_options.ptr);
} }
//we revert the ordering of the bruteforce to fix the first static character
if(rainy)
while (pos >= 0 && (++bf_options.state[bf_options.current-1-pos]) >= bf_options.crs_len) {
bf_options.state[bf_options.current-1-pos] = 0;
pos--;
}
else
while (pos >= 0 && (++bf_options.state[pos]) >= bf_options.crs_len) { while (pos >= 0 && (++bf_options.state[pos]) >= bf_options.crs_len) {
bf_options.state[pos] = 0; bf_options.state[pos] = 0;
pos--; pos--;

4
bfg.h
View file

@ -43,6 +43,10 @@ typedef struct {
char *crs; /* internal representation of charset */ char *crs; /* internal representation of charset */
char *ptr; /* ptr to the last generated password */ char *ptr; /* ptr to the last generated password */
uint32_t disable_symbols; uint32_t disable_symbols;
<<<<<<< HEAD
=======
uint64_t rotate;
>>>>>>> c65e3a2 (update efficient rain option)
} bf_option; } bf_option;
extern bf_option bf_options; extern bf_option bf_options;