Recently I've been studying the ECC with the Chinese SM2 standard. One question is on standard part 5, parameters definition, it only defines $p, a, b, n, XG,$ and $YG$, but not cofactor $h$.
I found some useful discussion introducing all the parameters mathematics behind: What is the relationship between p, n, and h.It doesn't answer my question: Why SM2 does not specify h, while Key Exchange Agreement Protocol introduce in SM2 part 3 has used it.
On the standard part 1, section 5.2.2, it provides a method to verify Elliptic Curve Parameters. One option process uses to verify $h$ is:
(optional) Calculate $h'=\lfloor((p^{1/2} + 1) ^ 2)/n\rfloor$, and verify $h=h'$
This also means h can be calculated by the equation above. I calculate with an online big number calculator, the result is slightly greater than 1 (not fully equal).
Or have I misunderstood this cofactor? It is calculated instead. Elliptic curve can be perfectly defined only with $p, a, b, n, XG$, and $YG$.
E.cardinality_pari()
is quite optimized, so it took a few seconds on my laptop. This answer used the more standard definition of co-factor from the answer by Squeamish Ossifrage you linked. Can you please locate the formula with $h'$ in the linked IETF draft or link the containing document? I failed to do so and thus didn't follow through on it, as I wasn't sure on a specific piece of notation. – SEJPM Dec 29 '18 at 11:30