Interpolation Attack The example of two round iterated cipher(each round is cubic function) here shows polynomial after two rounds with 9 terms.



however if we find the polynomial for two rounds, it has 22 terms



one clue i have is, the difference in number of terms may be because of underlying mathematics difference, (use of finite field in case of 9 terms, so similar terms getting cancelled out instead of being add up)

and is there some formula to just find the number of terms in expansion, like explain here
As in the first equation one has $(x+k_1)^3 = (x^2+k_1^2)(x+k_1)$, i.e., $(x+k_1)^2 = x^2+k_1^2$ I'd conclude that the equation is over characteristic $2$.

This explains why all the terms with even coefficients are missing and why all odd coefficients are replaced by $1$.

The only remaining mystery is what happened to $3k_1^6k_2$ rsp. $k_1^6k_2$. Typo?