0

How to calculate multiplicative inverse and additive inverse of elements of a field (In polynomial arithmetic) eg. what should be multiplicative inverse table of a field {0,1,2,3,4,5,6,7}

  • If you really intended to ask about how to do this in a field of 8 elements, then A) be advised that those elements are at most quadratic polynomials with coefficients in the field $\Bbb{F}_2={0,1}$ in an "unknown variable, say $\alpha$, that is specified to be a root of a chosen cubic polynomial. B) Calling those elements 0,1,2,3,4,5,6,7, is semicommon in computer implementations, because it is efficient to internally represent a quadratic polynomial simply as a vector with its coefficients. So $\alpha+1$ is represented as $011_2$ and $\alpha^2+1=101_2$. – Jyrki Lahtonen Sep 07 '17 at 09:00
  • (cont'd) C) but this is IMHO inferior because then you confuse users who may accidentally think that they can perform integer operations with those strings of bits. This is kinda non-sensical because you don't normally equate a character with its ASCII-code either even though internally to a computer there is no difference. – Jyrki Lahtonen Sep 07 '17 at 09:03
  • Anyway, for small fields using a look-up table of discrete logarithms is best, because the you can replace the kludgy multiplication of "polynomials" with modular addition of the discrete logarithms. You get the inverse from the same table by computing the modular additive inverse of the logarithm (very straightforward, the additive invers of $i$ is $-i$, now do it modulo seven instead). I have prepared a discrete logarithm table of the field of eight elements for referrals like this. Enjoy. – Jyrki Lahtonen Sep 07 '17 at 09:07

1 Answers1

1

There is a field with $8$ elements, but the elements of that field aren't usually called $\{0,1,2,3,4,5,6,7\}$. I think you meant $\{0,1,2,3,4,5,6\}$, together with the addition and multiplication which makes it into what is commonly called the integers modulo $7$, or the field with seven elements, and written as $\Bbb Z_7, \Bbb Z/7\Bbb Z$ or $\Bbb F_7$, depending on what property you want to emphasise.

If that is what you meant, then have you heard of Fermat's little theorem? It tells you that $x^5$ is the multiplicative inverse of $x$ modulo $7$. In general, modulo a prime $p$, and given a non-zero $x$, we have that $x^{p-2}$ is the multiplicative inverse of $x$. If $p$ is small, you can calculate it directly by multiplying $x$ with itself $p-2$ times and reducing modulo $p$ (or even just trying all numbers until you find the inverse), but if your $p$ is large, then exponentiation by squaring is probably the fastest way to calculate it.

Alternatively, you can use the extended Euclidean algorithm to find an $n$ and $m$ such that $nx + mp = 1$. Then, reducing modulo $p$ you're left with $nx = 1$, which means that $n$ is the multiplicative inverse of $x$.

Arthur
  • 199,419
  • Consider the division 5/3 within a set . If is the set of rational numbers, which is a field, then the result is simply expressed as 5/3 and is an element of .Now suppose that is the field Z7. In this case, we calculate 5/3 = (5 * 3-1) mod 7 = (5 * 5) mod 7 = 4 – vikas2cc Sep 07 '17 at 09:00
  • this is a snapshot of william stalling book of cryptography – vikas2cc Sep 07 '17 at 09:00
  • i want to know why they have written as inverse of – vikas2cc Sep 07 '17 at 09:01
  • In $\Bbb Z_7$, we have $3^{-1} = 5$ for the very simple reason that $3\cdot 5 = 1$. You can check that yourself. This is the defining property of the multiplicative inverse, and one can go on and prove that multiplicative inverses in a field are unique, so that $3^{-1}$ is $5$ and no other number. – Arthur Sep 07 '17 at 09:03
  • how u have drived it – vikas2cc Sep 07 '17 at 09:04
  • or please give me link of examples so i can read – vikas2cc Sep 07 '17 at 09:05
  • is there any method for this calculation – vikas2cc Sep 07 '17 at 09:07
  • @vikas2cc I gave you a method in my answer: $3^{-1} = 3^5$ modulo $7$. – Arthur Sep 07 '17 at 09:07
  • so i need to do 5 times multiplication then taking mod 7 ......is this the only efficient way – vikas2cc Sep 07 '17 at 09:10
  • @vikas2cc No, but it is the most efficient way that always works, no matter what modulo you have and what number you want to find the inverse of. For such a small modulo as $7$, you can just try all the options. There are only $4$ of them you should seriously consider ($0,1$ and $-1 = 6$ couldn't ever work, so you have to try $3\cdot 2, 3\cdot 3, 3\cdot 4$ and $3\cdot 5$. If you're clever, you see that $3\cdot 2 = -1$, so $3\cdot (-2)$ must necessarily be $1$.) – Arthur Sep 07 '17 at 09:25
  • 1
    If the intent really is to find a modular inverses, then the extended Euclidean algorithm is IMHO faster than raising to power $p-2$ (which isn't too slow either). But, because there is a field of eight elements such that some people (programmers, cryptopeople, but no algebraists) list its elements as ${0,1,2,3,4,5,6,7}$ I will refrain from giving my usual upvote, lest this is a misunderstanding. – Jyrki Lahtonen Sep 07 '17 at 09:39
  • @JyrkiLahtonen The extended Euclidean algorithm! I knew I'd forgotten something. – Arthur Sep 07 '17 at 10:03
  • @vikas2cc You can find a handful of methods for computing modular fractions in this answer. – Bill Dubuque Sep 07 '17 at 13:19