8.16.0.1
secp256k1
(require secp256k1) | package: secp256k1 |
struct
(struct elliptic-curve (a b field))
a : field-element? b : field-element? field : integer?
An elliptic curve, with each element respecting y^2 = x^3 + ax + b.
The elliptic curve is defined over a finite field
Prime of the field. value = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F"
Max val on the curve. value = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141"
value
A : field-element = (field-element 0 P)
The parameter A of the curve secp256k1. A = 0 mod P.
value
B : field-element = (field-element 7 P)
The parameter B of the curve secp256k1. A = 7 mod P.
value
secp256k1 : elliptic-curve = (elliptic-curve A B P)
The curve secp256k1.
struct
x : field-element? y : field-element? curve : elliptic-curve?
A point (x,y) on the curve
procedure
(point-to-string point) → string?
point : point?
Display a point element (concatenation of the x and y values, in hexadecimal)
procedure
(string-to-point point-hex #:curve curve?) → point?
point-hex : string? curve? : secp256k1
Return a point from a hexadecimal string and a curve
Return true if y^2 = x^3 + ax + b
value
=
(point (field-element 55066263022277343669578718895168534326250603453777594175500187360389116729240 P) (field-element 32670510020758816978083085130507043184471273380659243275938904335757337482424 P) secp256k1)
The generator of the curve.
The "0" point of the curve, or point at infinity.
Return point1 + point2, according to the addition rules for the elliptic curve secp256k1.
procedure
(rmul-point value scalar) → point?
value : point? scalar : integer?
Return value * scalar. Implemented as cumulative addition of the point with itself.