I'm a bit confused by the standards and some replies regarding zero (the point at infinity) in elliptic curves ElGamal.
TL;DR: Why do some people recommend excluding zero? It has nothing to do with key leakage due to insufficient order as those attacks are preventable by group membership checks (i.e. not related to zero explicitly).
Here it is argued that $0$ is a valid secret key from $\mathbb{Z}_q$. Mainly because if we exclude it, we can use the same reasoning to eliminate $1$, $2$, $42$, and virtually any key. The argument makes sense (see Pascal Junod's explanation). Plus academic publications support it.
However, when it comes to ECC, it gets blurry. Some recommend that zero (hence point-at-infinity) is excluded:
- Key validation that excludes infinity,
- ElGamal example with secret key range [1,N-1],
- ECC self-apply explanation for non-negative numbers only,
- NIST SP 800-186-draft prohibits the use of zero secret keys.
Yet there are exceptions:
- RFC 7748 does not mention infinity check,
- Bernstein et.al. argue that excluding weak keys (including zero) is not a way to go:
As I get it, the main concern is a potential secret key leakage in case the public key $Y$ does not have the expected order. However, it is easily preventable by checking group membership with $q \cdot Y = \mathcal{O}$, where $q$ is the curve order and $\mathcal{O}$ is a point at infinity.
Also, ECDH seems to have an issue when a shared secret is zero. But it's a hybrid encryption concern, not applicable to ElGamal.
Another explanation might be because the point at infinity does not have a coordinate representation for all curves, so implementation tries to avoid it.
Anyway, I don't see any valid reason to avoid zero:
- Yes, if your secret key happens to be zero then it's bad luck (check RBG); but the exact same logic applies to $1$, $2$, and so on.
- Key leakage is due to performing math with not-group-member points rather than zero itself.
- As for implementation, it has to deal with point-at-infinity anyway as it's a part of what makes curve points a group.
What am I missing? Why point-at-infinity is such an issue? It made its way to the NIST standard, so I assume there must be a good reason.
P.S. I think I'll settle for the "theory meets practice and adapts" answer. Guess that all crypto articles where I saw secret key derived from the entire $Z_q$ (or $GF(p)$) were studying ElGamal more from a theoretical side. While in practice, auditors probably weren't too thrilled to see zeros. Therefore zero was excluded from the standards (pure speculation on my side).