curve

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GOST34102001 *elliptic.CurveParams

Functions

func F

func F(ec elliptic.Curve, x *big.Int) (*big.Int, error)

F receives a big integer x as input and return x^3 + 7 mod ORDER.

Types

type Generator

type Generator struct {
	*Point
}

func GeneratorG

func GeneratorG(curve elliptic.Curve) (generator *Generator)

func GeneratorH

func GeneratorH(curve elliptic.Curve, ha gost3410.HashAlgorithm) (generator *Generator)

func NewGenerator

func NewGenerator(curve elliptic.Curve, ha gost3410.HashAlgorithm, seed []byte) (generator *Generator)

type Point

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

func MapToGroup

func MapToGroup(ec elliptic.Curve, ha gost3410.HashAlgorithm, m string) (*Point, error)

MapToGroup is a hash function that returns a valid elliptic curve point given as input a string. It is also known as hash-to-point and is used to obtain a generator that has no discrete logarithm known relation, thus addressing the concept of NUMS (nothing up my sleeve). This implementation is based on the paper: Short signatures from the Weil pairing Boneh, Lynn and Shacham Journal of Cryptology, September 2004, Volume 17, Issue 4, pp 297–319

func (*Point) Add

func (p *Point) Add(ec elliptic.Curve, a, b *Point) *Point

func (*Point) Bytes

func (p *Point) Bytes(curve elliptic.Curve) []byte

func (*Point) IsOnCurve

func (p *Point) IsOnCurve(ec elliptic.Curve) bool

IsOnCurve returns TRUE if and only if p has coordinates X and Y that satisfy the Elliptic Curve equation: y^2 = x^3 + 7.

func (*Point) IsZero

func (p *Point) IsZero() bool

func (*Point) Neg

func (p *Point) Neg(ec elliptic.Curve, a *Point) *Point

func (*Point) ScalarBaseMult

func (p *Point) ScalarBaseMult(ec elliptic.Curve, n *big.Int) *Point

ScalarBaseMult returns the Scalar Multiplication by the base generator.

func (*Point) ScalarMult

func (p *Point) ScalarMult(ec elliptic.Curve, a *Point, n *big.Int) *Point

func (*Point) SetInfinity

func (p *Point) SetInfinity() *Point

Jump to

Keyboard shortcuts

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