Documentation
¶
Overview ¶
Package weakkey finds elliptic-curve public keys whose private scalar is tiny.
A public key Q on a curve with generator G is Q = k·G. If k is small, anyone can recover it by stepping through G, 2G, 3G, ... until they reach Q. The eMudhra intermediates compromised in October 2026 had k below 256. This package checks every k up to Limit, and also n-k (the same point negated), so the answer is a proof, not a heuristic: when it reports k, then k·G (or (n-k)·G) equals the key.
Index ¶
Constants ¶
const Limit = 1 << 16
Limit is the largest scalar checked. Recovering any k below it takes a laptop well under a second, so a key in this range is as good as public.
Variables ¶
This section is empty.
Functions ¶
func SmallScalar ¶
SmallScalar reports the private scalar of pub when it is below Limit, or its negation n-k is. ok is false for any other key or an unsupported curve. The result is exact: the caller can confirm it with ScalarBaseMult.
Types ¶
This section is empty.