bitcoin-hs-0.0.1: Partial implementation of the Bitcoin protocol (as of 2013)

Bitcoin.Crypto.EC.Curve

Description

The secp256k1 Elliptic Curve.

At the moment somewhat slow :(

References:

Synopsis

# Documentation

data ECPoint Source #

A point on the elliptic curve secp256k1

Constructors

 ECPoint !Fp !Fp a "regular" element of the elliptic curve ECInfinity the point at infinity is the unit element

Instances

 Source # Methods(==) :: ECPoint -> ECPoint -> Bool #(/=) :: ECPoint -> ECPoint -> Bool # Source # Methods Source # MethodsshowList :: [ECPoint] -> ShowS #

# secp256k1 curve parameters.

Parameters of the secp256k1 elliptic curve.

• p is the order of the prime field we are working over
• a and b are the parameters in the curve equation y^2 = x^3 + a*x + b (but a=0 here)
• G is the generator of the subgroup in the curve
• n is the order of G, equivalently the size of the subgroup
• H is the cofactor (size of the curve divided by the size of the subgroup)

G is the base point, that is the generator; E = { G^i | iin Z } = { G^i | i<-[1..n] }

# Operations on the secp256k1 curve

Addition in the elliptic curve (or multiplication if you prefer to think it as a multiplicative group)

Doubling a point in the elliptic curve (multiplication by the integer 2)

Inverse (negation) in the elliptic curve

Multiplication by a positive integer (or exponentiation, if you think multiplicatively). This is slow, use the projective version instead!