i'm trying to implement parameters generation for ECDSA according to SEC1 v2.0:
Input: The approximate security level in bits = t is {80, 112, 128, 192, 256}
Output: Elliptic curve domain parameters over Fp: T = (p, a, b, G, n, h)
Here's the 2nd step of the algorithm:
2. Select elements (a, b) is Fp to determine the elliptic curve E(Fp) defined by the equation:
E : y^2 = x^3 + ax + b (mod p),
a base point G = (Gx, Gy) on E(Fp), a prime n which is the order of G, and an integer h which is the cofactor h = #E(Fp)/n, subject to the following constraints:
- 4a^3 + 27b^2 != 0(mod p).
- #E(Fp) != p.
- p^B != 1(mod n) for all 1 <= B < 100.
- h <= 2 ^ (t/8).
- n−1 and n+1 should each have a large prime factor r, which is large in the sense that log_n(r) > (19/20).
I haven't understood a lot of things in 2nd step.
How to selectYes it should, as far as i've understood.aandbfor E(Fp)? Should it be done randomly just to satisfy4a^3 + 27b^2 != 0(mod p)?How to find #E(Fp) -- the cardinality of E(Fp)?-- Schoof or SEA algorithm.- How to choose generator -- G = (Gx, Gy) and find its order
n? -- Random point should be chosen on a curve. Again not pretty sure about it.
EDIT: The point has to have a prime order. How can a point be chosen with a prime order?
P.S.
Thank you and sorry for my English;