Math

Overview

What the package computes. Short Weierstrass curves over a prime you pick and secp256k1 on its own

Two kinds of curve

Every curve here has the short Weierstrass form, y² = x³ + ax + b, over the integers mod a prime p. That covers the toy curves of a CTF and secp256k1 alike. The difference is in what you hand over.

Curves you definesecp256k1
Import@agntn/curves@agntn/curves/secp256k1
CurvedefineCurve({ a, b, p })fixed, from SEC 2
Points{ x, y } as bigints, null for infinitySEC1 hex, infinity refused
Scalarsany bigint1 to n - 1, hex or bigint
Extracounting, listing, orders, logsscalars mod n, lifting x
Agent toolcurves_computecurves_secp256k1_compute

Why two? A toy curve is about the group. Count the points, find an order, take a log. secp256k1 is about keys. Nobody counts its points, and a log on it is not happening.

Pages