Shrinker pseudo-random key generator

Shrinker generator based on LFSR implemented in other posts.

This generator is very fast. Generated bits seems to have a good cryptographic properties. String LFSR 1 is moved each time. The purpose of the function f is to shift register LFSR 2 in the case where one out of LFSR 1 or lower transfer operation, when the voltage on LFSR 1 is 0.
int shrinker() {
    int lf1 = lfsr_1();
    int lf2 = lfsr_2();

    while (lf1 != 1) {
        lf1 = lfsr_1();
        lf2 = lfsr_2();
    }
    return lf2;
}
Source code: https://github.com/khipis/c-unix-sandbox/blob/master/shift-registers/stopngo.c

Komentarze

Popularne posty