So we can't use 2 random p and n to generate a curve, right?
Of course they are not random. As I often said: "just test it". Use "y^2=x^3+7" and nothing else. Start from p=1, and keep increasing it. Each time, try to count all points. Then, you will get all images from my repository:
https://github.com/vjudeu/curves1000Because just now I used a different n without changing p and G, and when I used this new n as my private key I got an error.
Of course. Because n-value is not picked randomly. It is calculated. See, what Garlo Nicon did there:
https://bitcointalk.org/index.php?topic=5459153.0When he picked p=79 and y^2=x^3+7, then he reached n=67. He couldn't put n=68 or n=70. He calculated n=67, based on p-value, and the curve equation.
I would like to know the relation between p and n, because it seems that G is irrelevant in the curve calculations.
1. Of course, G is irrelevant. So, if you pick a different generator, then your curve will be as safe as usual. It will only affect signatures at most, or some protocols like "mining public keys", but not much more than that.
2. The relation between p and n is quite simple: you pick p-value, which is your modulo. Which means, if you calculate 2+2=4, and your p=3, then you have 2+2=1, because 4 mod 3 is equal to 1. And then, n-value is just the number of points for a given p-value. If you pick p=79, and create 79x79 bitmap, and then count all points, where y^2=x^3+7, then you will find 66 such points, and one point at infinity. Which means, n=67. But you cannot pick it, you have to calculate it.
Also this new n is not prime, it's just an odd number.
Then your curve is less safe, because there is a high chance to see patterns. Which means, in that case, h=1 may not be the right choice.
Note, I'm one of those dumb students that asks about something several times. So if I have asked this before just ignore.
I don't want to ignore all posts of all people, and stop posting forever. Every question was already answered, in 99% cases. But people still answer questions on forums, because it is needed. Also note that my own questions are already answered in different places. So, why I ask those questions? Because I care about spreading that knowledge, even if I know the answers.