ggmpc.curves

Supported elliptic curves.

Module Contents

Classes

Curve

Elliptic curve parameters.

Attributes

secp256k1

Secp256k1 ECDSA curve.

ed25519

Ed25519 EdDSA curve.

class ggmpc.curves.Curve(scalar_random, scalar_add, scalar_sub, scalar_mul, scalar_reduce, scalar_negate, scalar_invert, scalar_mul_base, point_add, point_mul, order, hash, verify)

Elliptic curve parameters.

Parameters:
  • scalar_random (function) – Function that returns a random field element.

  • scalar_add (function) – Function that returns the sum of two field elements modulo the order of the curve.

  • scalar_sub (function) – Function that returns the difference of two field elements modulo the order of the curve.

  • scalar_mul (function) – Function that returns the product of two field elements modulo the order of the curve.

  • scalar_reduce (function) – Function that reduces a scalar modulo the order of the curve.

  • scalar_invert (function) – Function that returns the modular multiplicative inverse of a field element.

  • scalar_negate (function) – Function that returns the negated field element modulo the order of the curve.

  • scalar_mul_base (function) – Function that multiplies the curve generator by a field element.

  • point_add (function) – Function that adds two group elements.

  • point_mul (function) – Function that multiplies a group element by a field element.

  • order (function) – Function that returns the order of the curve.

  • hash (function) – A hash function using a hashlib-like interface.

  • verify (function) – Function that verifies a signature.

ggmpc.curves.secp256k1

Secp256k1 ECDSA curve.

ggmpc.curves.ed25519

Ed25519 EdDSA curve.