p521

package
v0.0.0-...-86e0768 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Curve = elliptic.P521()

Curve uses elliptic curve P521

Functions

func Marshal

func Marshal(curve elliptic.Curve, x, y *big.Int) []byte

Marshal encodes a ECC Point into it's compressed representation

func Unmarshal

func Unmarshal(curve elliptic.Curve, data []byte) (x, y *big.Int)

Unmarshal decodes an ECC Point from any representation

Types

type ECPoint

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

ECPoint struct

func NewECPoint

func NewECPoint(x, y *big.Int) ECPoint

NewECPoint returns a new point (x,y)

func (ECPoint) Equals

func (ecp ECPoint) Equals(other ECPoint) bool

Equals function

func (*ECPoint) GobDecode

func (ecp *ECPoint) GobDecode(buf []byte) error

GobDecode checks decoding of encoded bytes is equal to ECpoint or not

func (ECPoint) GobEncode

func (ecp ECPoint) GobEncode() ([]byte, error)

GobEncode function encodes ECPoint to bytes

func (ECPoint) String

func (ecp ECPoint) String() string

type PolyCommit

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

PolyCommit struct a commitment to a polynomial {a0, a1, ..., at} is g^at ai are from the multiplicative group of integers modulo p

func AdditiveHomomorphism

func AdditiveHomomorphism(commQ, commR PolyCommit) PolyCommit

AdditiveHomomorphism return a commitment to Q+R

func NewPolyCommit

func NewPolyCommit(polynomial polyring.Polynomial) PolyCommit

NewPolyCommit returns a commitment to an input polynomial

func (PolyCommit) Bytes

func (comm PolyCommit) Bytes() []byte

Bytes encodes a commitment to binary bytes using GobEncode()

func (PolyCommit) Equals

func (comm PolyCommit) Equals(other PolyCommit) bool

Equals checks if polyCommits are equal or not

func (*PolyCommit) GobDecode

func (comm *PolyCommit) GobDecode(buf []byte) error

GobDecode returns a decoded commitment from input bytes

func (PolyCommit) GobEncode

func (comm PolyCommit) GobEncode() ([]byte, error)

GobEncode returns an encoded commitment to bytes

func (PolyCommit) Print

func (comm PolyCommit) Print()

Print prints a commitment

func (PolyCommit) String

func (comm PolyCommit) String() string

String converts a commitment to a string

func (PolyCommit) Verify

func (comm PolyCommit) Verify(poly polyring.Polynomial) bool

Verify verifies whether commitment to a polynomial is correct or not

func (PolyCommit) VerifyEval

func (comm PolyCommit) VerifyEval(x *big.Int, y *big.Int) bool

VerifyEval verifies a commitment using (x,y)

Jump to

Keyboard shortcuts

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