Skip to main content

detect_algebraic_recurrence

Function detect_algebraic_recurrence 

Source
pub fn detect_algebraic_recurrence(
    bits: &[bool],
    l: usize,
    d: usize,
) -> Option<Vec<bool>>
Expand description

Recover the algebraic normal form of a degree-≤ d, order-l nonlinear feedback: the ANF coefficient vector over [monomials](l, d) such that replaying s[i] = ⊕ₘ cₘ · monomialₘ(window) reproduces bits exactly. Returns None if no such low-degree feedback fits (the GF(2) system is inconsistent, or the recovered coefficients fail to regenerate the sequence). This is the degree-d generalization of berlekamp_massey_gf2 (which is the d = 1 case): it compresses low-degree nonlinear generators that fool the linear, 2-adic, and maximal-order tests.