Documentation ¶
Index ¶
- Variables
- func Marshal(curve elliptic.Curve, x, y *big.Int) []byte
- func Unmarshal(curve elliptic.Curve, data []byte) (x, y *big.Int)
- type ECPoint
- type PolyCommit
- func (comm PolyCommit) Bytes() []byte
- func (comm PolyCommit) Equals(other PolyCommit) bool
- func (comm *PolyCommit) GobDecode(buf []byte) error
- func (comm PolyCommit) GobEncode() ([]byte, error)
- func (comm PolyCommit) Print()
- func (comm PolyCommit) String() string
- func (comm PolyCommit) Verify(poly polyring.Polynomial) bool
- func (comm PolyCommit) VerifyEval(x *big.Int, y *big.Int) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var Curve = elliptic.P521()
Curve uses elliptic curve P521
Functions ¶
Types ¶
type ECPoint ¶
type ECPoint struct {
// contains filtered or unexported fields
}
ECPoint struct
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) 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 ¶
VerifyEval verifies a commitment using (x,y)
Click to show internal directories.
Click to hide internal directories.