CSC327 ยท 2081 ยท 5 marks
Find the multiplicative inverse of polynomial (95) using extended euclidean Algorithm.
Find the multiplicative inverse of polynomial (95) using extended euclidean Algorithm. [5]
Multiplicative Inverse in GF(2โธ) using the Extended Euclidean Algorithm
Given
- Element to invert: 95 (hexadecimal), interpreted as an element of $GF(2^8)$.
- $95_{16} = 1001,0101_2$, giving polynomial
$$b(x) = x^7 + x^4 + x^2 + 1$$
- AES irreducible (reduction) polynomial:
$$m(x) = x^8 + x^4 + x^3 + x + 1$$
Note: The question only states "95" and "extended Euclidean algorithm". The irreducible polynomial is not explicitly given; the AES standard modulus is assumed since this is the standard BIT/cryptography context.
Goal: find $b(x)^{-1} \bmod m(x)$.
Solution
All arithmetic is in $GF(2)$ (addition = XOR).
Initialize:
- $r_0 = m(x)=x^8+x^4+x^3+x+1$, $; t_0=0$
- $r_1 = b(x)=x^7+x^4+x^2+1$, $; t_1=1$
Recurrence: $r_{i+1}=r_{i-1}-q_i r_i$, $;t_{i+1}=t_{i-1}-q_i t_i$.
Division 1: $r_0 \div r_1$
$$x^8+x^4+x^3+x+1 ;=; x\cdot(x^7+x^4+x^2+1) + r_2$$
$x\cdot b = x^8+x^5+x^3+x$. XOR:
$$r_2 = (x^8+x^4+x^3+x+1)\oplus(x^8+x^5+x^3+x)=x^5+x^4+1$$
- $q_1=x$
- $t_2=t_0-q_1t_1 = 0 - x\cdot1 = x$
Division 2: $r_1 \div r_2$
Divide $x^7+x^4+x^2+1$ by $x^5+x^4+1$:
- $x^2$: $x^2(x^5+x^4+1)=x^7+x^6+x^2$; XOR โ $x^6+x^4+1$
- $x$: $x(x^5+x^4+1)=x^6+x^5+x$; XOR โ $x^5+x^4+x+1$
- $1$: $x^5+x^4+1$; XOR โ $x$
So:
- $q_2=x^2+x+1$, $; r_3=x$
- $t_3=t_1-q_2t_2 = 1 - (x^2+x+1)(x) = 1+(x^3+x^2+x)=x^3+x^2+x+1$
Division 3: $r_2 \div r_3$
Divide $x^5+x^4+1$ by $x$:
$$x^5+x^4+1 = x\cdot(x^4+x^3)+1$$
So:
- $q_3=x^4+x^3$, $; r_4=1$
- $t_4=t_2-q_3t_3 = x - (x^4+x^3)(x^3+x^2+x+1)$
Compute $(x^4+x^3)(x^3+x^2+x+1)$:
$x^4\cdot(x^3+x^2+x+1)=x^7+x^6+x^5+x^4$ $x^3\cdot(x^3+x^2+x+1)=x^6+x^5+x^4+x^3$
XOR (add): $x^6\oplus x^6=0$, $x^5\oplus x^5=0$, $x^4\oplus x^4=0$:
$$=x^7+x^3$$
Then:
$$t_4 = x \oplus (x^7+x^3) = x^7+x^3+x$$
Since $r_4 = 1 = \gcd$, the inverse of $b(x)$ modulo $m(x)$ is $t_4$.
Verification
$$b(x)^{-1} = x^7 + x^3 + x$$
Check $b(x)\cdot t_4 \bmod m(x)$:
$b = x^7+x^4+x^2+1$, $t_4=x^7+x^3+x$.
Product:
- $x^7\cdot t_4 = x^{14}+x^{10}+x^8$
- $x^4\cdot t_4 = x^{11}+x^7+x^5$
- $x^2\cdot t_4 = x^9+x^5+x^3$
- $1\cdot t_4 = x^7+x^3+x$
XOR all: $x^5\oplus x^5=0$, $x^7\oplus x^7=0$, $x^3\oplus x^3=0$:
$$= x^{14}+x^{11}+x^{10}+x^9+x^8+x$$
Reduce mod $m(x)=x^8+x^4+x^3+x+1$ (i.e. $x^8\equiv x^4+x^3+x+1$):
-
$x^8\equiv x^4+x^3+x+1$
-
$x^9\equiv x^5+x^4+x^2+x$
-
$x^{10}\equiv x^6+x^5+x^3+x^2$
-
$x^{11}\equiv x^7+x^6+x^4+x^3$
-
$x^{14}=x^6\cdot x^8\equiv x^6(x^4+x^3+x+1)=x^{10}+x^9+x^7+x^6$
reduce: $x^{10}\to x^6+x^5+x^3+x^2$, $x^9\to x^5+x^4+x^2+x$ $x^{14}\equiv (x^6+x^5+x^3+x^2)+(x^5+x^4+x^2+x)+x^7+x^6$ $= x^7+x^4+x^3+x$
Sum all reduced terms (XOR):
| term | reduced |
|---|---|
| $x^{14}$ | $x^7+x^4+x^3+x$ |
| $x^{11}$ | $x^7+x^6+x^4+x^3$ |
| $x^{10}$ | $x^6+x^5+x^3+x^2$ |
| $x^9$ | $x^5+x^4+x^2+x$ |
| $x^8$ | $x^4+x^3+x+1$ |
| $x$ | $x$ |
XOR column by column:
- $x^7$: $1+1=0$
- $x^6$: $1+1=0$
- $x^5$: $1+1=0$
- $x^4$: $1+1+1+1=0$
- $x^3$: $1+1+1+1=0$
- $x^2$: $1+1=0$
- $x^1$: $1+1+1+1=0$
- $x^0$: $1$
$$= 1 \checkmark$$
Final Answer
$$\boxed{b(x)^{-1} = x^7 + x^3 + x}$$
In binary: $1000,1010$, i.e. hexadecimal 8A.
Completing the computation through $t_4$ gives the inverse $x^7+x^3+x$, which multiplies back to $1$.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.