Documentation
¶
Overview ¶
Package fit holds closed-form byte-function fitters over Z/256: given observed (input → output) byte pairs, find the affine coefficients that best explain them and report how many observations conflict. A zero-conflict fit means the data follows that closed form; a nonzero floor is the toolkit's evidence that no such low-degree form exists (the signature of a hidden table).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Affine1 ¶
Affine1 is the best affine model Y = A·X + B (mod 256) for the data, together with the count of observations it fails to reproduce.
func FitAffine1 ¶
FitAffine1 returns the affine model minimizing conflicts. It is exact and fast: for each of the 256 candidate slopes A, the intercept is forced by the first observation and the rest are checked. RequireOddA restricts the slope to invertible (odd) multipliers — the regime the alias keystream fit lives in.
type Affine2 ¶
Affine2 is the best affine model Z = A·X + B·Y + C (mod 256).
func FitAffine2 ¶
FitAffine2 fits Z = A·X + B·Y + C by brute-forcing the slope A and reducing the remainder to a one-input affine fit in Y. Cost is O(256·256·N); intended for bounded observation sets (callers subsample for the full 32,768-gauge sweep and log the cap).