ecgo

package
v0.0.0-...-bf84be7 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: BSD-3-Clause Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EQTypeNone             = iota
	EQTypeUninitialized    = iota
	EQTypeShortWeierstrass = iota
	EQTypeEdwards          = iota
	EQTypeMontgomery       = iota
	EQTypeTwistedEdwards   = iota
)

curve types

Variables

This section is empty.

Functions

func CurveNames

func CurveNames() []string

Types

type Curve

type Curve struct {
	// contains filtered or unexported fields
}

func EdwardsCurve

func EdwardsCurve(p, c, d, n, h, gx, gy *big.Int, bits uint) *Curve

func MontgomeryCurve

func MontgomeryCurve(p, B, A, n, h, gx, gy *big.Int, bits uint) *Curve

func NamedCurve

func NamedCurve(name string) (z *Curve)

func ShortWeierstrassCurve

func ShortWeierstrassCurve(p, a, b, n, h, gx, gy *big.Int, bits uint) *Curve

func TwistedEdwardsCurve

func TwistedEdwardsCurve(p, a, d, n, h, gx, gy *big.Int, bits uint) *Curve

func (*Curve) Cmp

func (z *Curve) Cmp(a *Curve) int

func (*Curve) GetAttr

func (z *Curve) GetAttr(attr string) (r *big.Int)

func (*Curve) PointCheck

func (z *Curve) PointCheck(gx, gy *big.Int) bool

func (*Curve) Type

func (z *Curve) Type() (r int)

type ECDSASignature

type ECDSASignature struct {
	// contains filtered or unexported fields
}

func (*ECDSASignature) AsBytes

func (sig *ECDSASignature) AsBytes() []byte

func (*ECDSASignature) Verify

func (sig *ECDSASignature) Verify(pK *Point, message []byte) bool

type ECDSASignatureScheme

type ECDSASignatureScheme struct {
	// contains filtered or unexported fields
}

func NewECDSASignatureScheme

func NewECDSASignatureScheme(c *Curve, h hash.Hash) (ss *ECDSASignatureScheme)

func (*ECDSASignatureScheme) Sign

func (ss *ECDSASignatureScheme) Sign(sK *big.Int, message []byte) *ECDSASignature

func (*ECDSASignatureScheme) SignatureFromBytes

func (ss *ECDSASignatureScheme) SignatureFromBytes(gobytes []byte) *ECDSASignature

type ECElgamalCiphertext

type ECElgamalCiphertext struct {
	// contains filtered or unexported fields
}

func ECElgamalEncrypt

func ECElgamalEncrypt(pK *Point, ptxt *Point) (ctxt *ECElgamalCiphertext)

func NewECElgamalCiphertext

func NewECElgamalCiphertext(c, d *Point) (ctxt *ECElgamalCiphertext)

func (*ECElgamalCiphertext) C

func (ctxt *ECElgamalCiphertext) C() (c *Point)

func (*ECElgamalCiphertext) D

func (ctxt *ECElgamalCiphertext) D() (d *Point)

func (*ECElgamalCiphertext) Decrypt

func (ctxt *ECElgamalCiphertext) Decrypt(sK *big.Int) (ptxt *Point)

type FieldElement

type FieldElement struct {
	// contains filtered or unexported fields
}

func NewFieldElement

func NewFieldElement(value, field *big.Int) (z *FieldElement)

func NewFieldElementUI

func NewFieldElementUI(value uint64, field *big.Int) (z *FieldElement)

func NewFieldElementURandom

func NewFieldElementURandom(field *big.Int) (z *FieldElement)

func (*FieldElement) Add

func (z *FieldElement) Add(a, b *FieldElement) *FieldElement

func (*FieldElement) AsInt

func (z *FieldElement) AsInt() (r *big.Int)

func (*FieldElement) Bit

func (z *FieldElement) Bit(i int) uint

func (*FieldElement) Cmp

func (z *FieldElement) Cmp(a *FieldElement) int

func (*FieldElement) Exp

func (*FieldElement) Inv

func (z *FieldElement) Inv(a *FieldElement) (fe *FieldElement, err error)

func (*FieldElement) Mul

func (z *FieldElement) Mul(a, b *FieldElement) *FieldElement

func (*FieldElement) Neg

func (*FieldElement) Order

func (z *FieldElement) Order() (r *big.Int)

func (*FieldElement) Sqrt

func (z *FieldElement) Sqrt(a *FieldElement) (fe *FieldElement, err error)

func (*FieldElement) Sub

func (z *FieldElement) Sub(a, b *FieldElement) *FieldElement

type Point

type Point struct {
	// contains filtered or unexported fields
}

func NewPointFromBytes

func NewPointFromBytes(gby []byte, c *Curve) (z *Point)

func NewPointFromString

func NewPointFromString(gst string, c *Curve) (z *Point)

func NewPointGenerator

func NewPointGenerator(c *Curve) (z *Point)

func NewPointNeutral

func NewPointNeutral(c *Curve) (z *Point)

func NewPointURandom

func NewPointURandom(c *Curve) (z *Point)

func NewPointXY

func NewPointXY(x, y *big.Int, c *Curve) (z *Point)

func (*Point) Add

func (z *Point) Add(a, b *Point) *Point

func (*Point) Affine

func (z *Point) Affine() (x, y *big.Int)

func (*Point) BytesCompressed

func (z *Point) BytesCompressed() []byte

func (*Point) BytesUncompressed

func (z *Point) BytesUncompressed() []byte

func (*Point) Cmp

func (z *Point) Cmp(a *Point) int

func (*Point) IsNeutral

func (z *Point) IsNeutral() bool

func (*Point) Mul

func (z *Point) Mul(a *Point, b *big.Int) *Point

func (*Point) Neg

func (z *Point) Neg(a *Point) *Point

func (*Point) Set

func (z *Point) Set(a *Point) *Point

func (*Point) SetupBaseMul

func (z *Point) SetupBaseMul()

func (*Point) StringCompressed

func (z *Point) StringCompressed() string

func (*Point) StringUncompressed

func (z *Point) StringUncompressed() string

func (*Point) Sub

func (z *Point) Sub(a, b *Point) *Point

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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