Is Secp256k1's prime prime?

917 Views Asked by At

Bitcoin protocol relies on the elliptic curve secp256k1 for its cryptographic security. For that purpose the integer number $p = 2^{256}-2^{32}-977$ must be prime. How do they know $p$ is actually prime? I mean, which primality test can be used to prove it?

1

There are 1 best solutions below

12
On

As pointed out in the comments, this is not a large number to factorise with modern methods.

The Magma online calculator http://magma.maths.usyd.edu.au/calc/ verifies that it is prime, when asked to factor it, almost instantly.

time Factorisation(2^256-2^32-977);

returns

[ <115792089237316195423570985008687907853269984665640564039457584007908834671663, 1> ] Time: 0.070

as the factorisation into powers of primes; the number $2^{256}-2^{32}-977$ is a single prime to the power $1$. It takes 0.07 seconds to get this result.

Primality testing is consistent as well.

time IsPrime(2^256-2^32-977);

yields

true Time: 0.060