3 ms·
Thanks! I took some inspiration from discussion on that page, however my solution differs because instead of hard coding everything it instead calculates the mu
by juliusgeo 4y ago
Thanks! I took some inspiration from discussion on that page, however my solution differs because instead of hard coding everything it instead calculates the multiplicative inverse and affine transformation separately. This is worse in terms of space but it lets you more clearly represent the two s-boxes as those two operations composed applied element wise to [0, 256]. You can also use this code to do multiplicative inverses over any field GF(2^n), just change the parameters and supply a new irreducible polynomial. I implement the totality of binary finite field arithmetic here: https://gist.github.com/juliusgeo/9e4eff4c0519f7f7b9af122d59a3253e https://gist.github.com/juliusgeo/9e4eff4c0519f7f7b9af122d59...