From The EAX Mode of Operation:
We explain the notation used in the definition of OMAC. The value of iL (line 40: i an integer in {2, 4} and L ∈ {0, 1}n) is the n-bit string that is obtained by multiplying L by the n-bit string that represents the number i. The multiplication is done in the finite field GF(2n) using a canonical polynomial to represent field points. The canonical polynomial we select is the lexicographically first polynomial among the irreducible polynomials of degree n that have a minimum number of nonzero coefficients. For n = 128 the indicated polynomial is x128 + x7 + x2 + x + 1. In that case, 2L = L << 1 if the first bit of L is 0 and 2L = (L << 1) ⊕ 012010000111 otherwise, where L << 1 means the left shift of L by one position (the first bit vanishing and a zero entering into the last bit). The value of 4L is simply 2(2L). We warn that to avoid side-channel attacks one must implement the doubling operation in a constant-time manner.
I was basically just given that the polynomial to use in the finite multiplication for n = 128 is x128 + x7 + x2 + x + 1. I want my implementation to be abstract in that it isn't reliant on the specifics of the cypher being used. To allow the block size n to be any number rather than hardcoding 128 or a few others, how can I have my software compute the correct polynomial?