Skip to main content

correlation_attack

Function correlation_attack 

Source
pub fn correlation_attack(
    keystream: &[bool],
    taps: &[bool],
) -> Option<CorrelationAttack>
Expand description

Siegenthaler’s basic correlation attack: recover the initial state of the length-L LFSR with feedback taps that best correlates with keystream, by exhaustive search over the 2^L − 1 nonzero initial states (each scored by agreement with the keystream). Returns the best state with its bias — significant only when bias clears spurious_bias_floor(L, n). Cost O(2^L·n); returns None for an empty register, a register longer than the keystream, or L > 20 (past the exhaustive cap — the domain of the fast-correlation attack, its scaling successor).