Jimmy Song ‘Programming Bitcoin’ book math doubt


I guess this is a math question and not a bitcoin question, but I would have a hard time expressing the doubt in a math forum, whereas here, maybe someone who knows the book and has the right knowledge can answer me easily.

In chapter 1, exercise 8, where Finite Fields division is practiced, there is this exercise about the Finite Field: F31:


And the answer is:

pow(17, prime-4, prime)

I don’t know why it is prime-4 instead of prime-2, how is this decomposed?


Source link

Leave a reply