We start with four elliptic curves, which were constructed together (because of how the half of the generator is set in all of them). We have
secp160k1,
secp192k1,
secp224k1, and
secp256k1. When we want to compute square roots and cube roots, then for three of them, it works fine for their p-values:
secp160k1:
p=0xfffffffffffffffffffffffffffffffeffffac73
n=0x0100000000000000000001b8fa16dfab9aca16b6b3
(p+1)/4=0x3fffffffffffffffffffffffffffffffbfffeb1d
(p+2)/9=0x1c71c71c71c71c71c71c71c71c71c71c55554c0d
0x1000000000^0x3fffffffffffffffffffffffffffffffbfffeb1d^0x1c71c71c71c71c71c71c71c71c71c71c55554c0d=0x40 (mod p)
secp192k1:
p=0xfffffffffffffffffffffffffffffffffffffffeffffee37
n=0xfffffffffffffffffffffffe26f2fc170f69466a74defd8d
(p+1)/4=0x3fffffffffffffffffffffffffffffffffffffffbffffb8e
(p+2)/9=0x1c71c71c71c71c71c71c71c71c71c71c71c71c71aaaaa8b1
0x1000000000^0x3fffffffffffffffffffffffffffffffffffffffbffffb8e^0x1c71c71c71c71c71c71c71c71c71c71c71c71c71aaaaa8b1=0x40 (mod p)
secp256k1:
p=0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f
n=0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141
(p+1)/4=0x3fffffffffffffffffffffffffffffffffffffffffffffffffffffffbfffff0c
(p+2)/9=0x1c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c555554e9
0x1000000000^0x3fffffffffffffffffffffffffffffffffffffffffffffffffffffffbfffff0c^0x1c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c555554e9=0x40 (mod p)
However, the same method won't work for p-value in secp224k1 for some reason:
p=0xfffffffffffffffffffffffffffffffffffffffffffffffeffffe56d
n=0x10000000000000000000000000001dce8d2ec6184caf0a971769fb1f7
p%4=1 (failed, expected 3)
p%9=1 (failed, expected 7)
If all of those curves were generated together, then why p-value for secp224k1 was picked differently, than for three other curves? And how to efficiently compute square roots and cube roots for this curve? Also, how to proceed with all n-values? I heard there are some algorithms, to compute those results for any values, but if those curves were selected specifically, to make operations like that "fast", then everything should be solvable by simple equations like "(p+x)/y", similar to "(p+1)/4" and "(p+2)/9", right?