Repository navigation
v0.1.0a1
Pre-release
Pre-release
[0.1.0a1] - 2026-09-10
First release to the Python Package Index. Alpha: published to reserve the name
and exercise the release path, not to signal a stable interface.
This is the first tagged version, so the entries below describe the shape the
interface reached on the way here rather than changes against a previous
release.
Packaging
- Distributed as the
tiny_ecdhimport package (the earlier flatecdhand
utilstop-level modules are gone). - Ships
py.typed; the public surface is type-hinted. - Single version source:
tiny_ecdh/_version.py, exposed as
tiny_ecdh.__version__and as the distribution version via a dynamic
pyproject.tomlfield. - Runs on numpy 1.x and numpy 2.x (the earlier
OverflowErrorin
bitvec_clr_biton numpy >= 2 is fixed). - Published from a tag by a GitHub Actions workflow using PyPI Trusted
Publishing (OIDC, no stored token) with PEP 740 build provenance. The sdist
and wheel are byte-reproducible from the tag with the pinned build toolchain
inrequirements/build.txt; CI rebuilds and compares hashes on every release.
Interface
- Keys and secrets are typed objects, not bare tuples:
PrivateKey,
PublicKey,SharedSecret. Fields are validated at construction. - Typed error hierarchy rooted at
TinyECDHError
(InvalidPrivateKeyError,InvalidPublicKeyError,InvalidSharedSecretError,
PublicKeyCoordinateRangeError,PublicKeyNotOnCurveError,
PublicKeyPointAtInfinityError,PublicKeyNotInSubgroupError). ecdh_generate_keys()draws the private scalar from the operating system
CSPRNG. It no longer accepts a caller-supplied or seedable RNG; tests inject a
namedentropy_sourceonly.PublicKeyconstruction rejects points that are not on the curve, are the
point at infinity, or are outside the base-point subgroup, each with a
distinct error type.- Fixed-width
bytes/hexencoding and decoding for keys, with
FIELD_BYTE_LENGTH,PRIVATE_KEY_BYTE_LENGTH,PUBLIC_KEY_BYTE_LENGTH. - Scalar multiplication runs a fixed number of steps per scalar bit-length.
Shared-secret format (changed)
ecdh_shared_secret(private_key, peer_public_key)returns aSharedSecret
wrapping the agreed point's x-coordinate. It no longer returns, or writes
back into the caller's array, the raw unhashedx || ybytes, and it no
longer mutates the peer's public key.- Key material must be derived explicitly:
SharedSecret.derive_key(context)
applies a KDF over the x-coordinate and returns a fixed-length key.
DEFAULT_SHARED_KEY_LENGTHandconstant_time_compareare exported for
callers. This format is not covered by any stability guarantee and may
change before 1.0.0.
Known limitations (unchanged, by design)
- ~80-bit curve strength (sect163r2 / NIST B-163), below every current
minimum; the curve is deprecated for new use. - Secret-dependent timing in the pure-Python field arithmetic is present and
documented, not eliminated. - No zeroisation of secret material. No independent review.