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?


1 Answer 1


Ok, I found later on the book...

Is about how to handle negative exponents using Fermat's little theorem.

ap-1 = 1

so if a = 17

17-3 = 17-3 * 1 = 17-3 * 17p-1 = 17p-4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.