ec

package
v0.0.0-...-ebe53a7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2014 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBigInt

func NewBigInt(v string, base int) *big.Int

Types

type Point

type Point struct {
	X      *big.Int
	Y      *big.Int
	Finite bool
}

func InfinitePoint

func InfinitePoint() *Point

func NewPoint

func NewPoint(x string, y string, base int) *Point

func (*Point) Copy

func (p *Point) Copy() *Point

func (*Point) Eq

func (p *Point) Eq(p2 *Point) bool

func (*Point) Print

func (p *Point) Print()

type PrimeCurve

type PrimeCurve struct {
	P *big.Int // Prime modulus (NIST: p)
	A *big.Int // y^2 = x^3 + Ax + b (NIST: a = -3)
	B *big.Int // y^2 = x^3 + ax + B (NIST: b)
	G *Point   // Generator (NIST: G)
	N *big.Int // Order of Generator (NIST: R)
	H *big.Int // Cofactor (NIST: f = 1)
}

func NewP256Curve

func NewP256Curve() *PrimeCurve

func NewPrimeCurve

func NewPrimeCurve(p, a, b, gx, gy, n, h *big.Int) *PrimeCurve

func (*PrimeCurve) Add

func (c *PrimeCurve) Add(p1 *Point, p2 *Point) *Point

func (*PrimeCurve) Double

func (c *PrimeCurve) Double(p1 *Point) *Point

func (*PrimeCurve) Satisfied

func (c *PrimeCurve) Satisfied(p *Point) bool

func (*PrimeCurve) ScalarMultiply

func (c *PrimeCurve) ScalarMultiply(scalar *big.Int, p1 *Point) *Point

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL