I wonder is there any easy way to evaluate elements of GF$(256)$: meaning that I would like to know what $\alpha^{32}$ or $\alpha^{200}$ is in polynomial form? I am assuming that the primitive polynomial is $D^8+D^4+D^3+D^2+1$. For example for GF$(8)$ what we do is as follow to calculate $\alpha^3$ is divide it by $\alpha^3+\alpha+1$ and we get $\alpha+1$ but here in GF$(256)$ this will be really tedious so I would like to know is there any way to calculate above expressions or similar expressions like $\alpha^{100}$ in GF$(256)$.
Thanks.
NOTE: None of the following Python code has been tested. Furthermore, it's not real code but rather pseudo-code adapted to Python in order to explain a rigorous algorithm while making it readable as possible to people who don't know code or don't know Python.
Wikipedia has a very helpful algorithm for this and it is about the exact field you are dealing with. Let $\mathbf a$ be the first multiplicand and $\mathbf b$ be the second multiplicand. Now, initialize $\mathbf p=0$. At the end, the variable $\mathbf p$ will have the product. Wikipedia describes with more detail into the binary bit manipulations with this algorithm than I do, but here's the pseudo-Python code:
Now, we need to combine this with @stewbasic's idea of exponentiation by squaring:
For some $GF(2^m)$, the
multiplyfunction has aforloop ofmand theexponentiationfunction has aforloop ofmin which themultiplyfunction is called 1-2 times each loop around. Therefore, this is a $O(m^2)$ algorithm, which is quite reasonable for your case of $m=8$.