Documentation ¶
Index ¶
- Constants
- func CheckDuplicateScalarArray(arr []*Scalar) bool
- func Compare(sca, scb *Scalar) int
- func IsPointEqual(pa *Point, pb *Point) bool
- func IsScalarEqual(sc1, sc2 *Scalar) bool
- func Reverse(x C25519.Key) (result C25519.Key)
- type PedersenCommitment
- type Point
- func (p *Point) Add(pa, pb *Point) *Point
- func (p *Point) AddPedersen(a *Scalar, A *Point, b *Scalar, B *Point) *Point
- func (p *Point) AddPedersenCached(a *Scalar, APreCompute [8]C25519.CachedGroupElement, b *Scalar, ...) *Point
- func (p *Point) Derive(pa *Point, a *Scalar, b *Scalar) *Point
- func (p *Point) FromBytes(b [Ed25519KeySize]byte) (*Point, error)
- func (p *Point) FromBytesS(b []byte) (*Point, error)
- func (p Point) GetKey() C25519.Key
- func (p *Point) Identity() *Point
- func (p *Point) InvertScalarMult(pa *Point, a *Scalar) *Point
- func (p *Point) InvertScalarMultBase(a *Scalar) *Point
- func (p Point) IsIdentity() bool
- func (p Point) MarshalText() []byte
- func (p *Point) MultiScalarMult(scalarLs []*Scalar, pointLs []*Point) *Point
- func (p *Point) MultiScalarMultCached(scalarLs []*Scalar, pointPreComputedLs [][8]C25519.CachedGroupElement) *Point
- func (p Point) PointValid() bool
- func (p *Point) ScalarMult(pa *Point, a *Scalar) *Point
- func (p *Point) ScalarMultBase(a *Scalar) *Point
- func (p *Point) Set(q *Point) *Point
- func (p *Point) SetKey(a *C25519.Key) (*Point, error)
- func (p Point) String() string
- func (p *Point) Sub(pa, pb *Point) *Point
- func (p Point) ToBytes() [Ed25519KeySize]byte
- func (p Point) ToBytesS() []byte
- func (p *Point) UnmarshalText(data []byte) (*Point, error)
- type Scalar
- func (sc *Scalar) Add(a, b *Scalar) *Scalar
- func (sc *Scalar) Exp(a *Scalar, v uint64) *Scalar
- func (sc *Scalar) FromBytes(b [Ed25519KeySize]byte) *Scalar
- func (sc *Scalar) FromBytesS(b []byte) *Scalar
- func (sc *Scalar) FromUint64(i uint64) *Scalar
- func (sc Scalar) GetKey() C25519.Key
- func (sc *Scalar) Invert(a *Scalar) *Scalar
- func (sc *Scalar) IsOne() bool
- func (sc *Scalar) IsZero() bool
- func (sc Scalar) MarshalText() []byte
- func (sc *Scalar) Mul(a, b *Scalar) *Scalar
- func (sc *Scalar) MulAdd(a, b, c *Scalar) *Scalar
- func (sc *Scalar) ScalarValid() bool
- func (sc *Scalar) Set(a *Scalar) *Scalar
- func (sc *Scalar) SetKey(a *C25519.Key) (*Scalar, error)
- func (p *Scalar) SetKeyUnsafe(a *C25519.Key) *Scalar
- func (sc Scalar) String() string
- func (sc *Scalar) Sub(a, b *Scalar) *Scalar
- func (sc Scalar) ToBytes() [Ed25519KeySize]byte
- func (sc Scalar) ToBytesS() []byte
- func (sc *Scalar) ToUint64Little() uint64
- func (sc *Scalar) UnmarshalText(data []byte) (*Scalar, error)
Constants ¶
View Source
const ( Ed25519KeySize = 32 TxRandomIndexSize = 4 CStringBulletProof = "bulletproof" CStringAssetTag = "blindedassettag" CStringOTA = "onetimeaddress" )
Variables ¶
This section is empty.
Functions ¶
func IsPointEqual ¶
func IsScalarEqual ¶
Types ¶
type PedersenCommitment ¶
type PedersenCommitment struct {
G []*Point // generators
}
PedersenCommitment represents the parameters for the commitment
var PedCom PedersenCommitment = NewPedersenParams()
func NewPedersenParams ¶
func NewPedersenParams() PedersenCommitment
func (PedersenCommitment) CommitAll ¶
func (com PedersenCommitment) CommitAll(openings []*Scalar) (*Point, error)
CommitAll commits a list of PCM_CAPACITY value(s)
func (PedersenCommitment) CommitAtIndex ¶
func (com PedersenCommitment) CommitAtIndex(value, rand *Scalar, index byte) *Point
CommitAtIndex commits specific value with index and returns 34 bytes g^v x h^rand
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
var GBase, HBase, RandomBase *Point
func HashToPoint ¶
func HashToPointFromIndex ¶
func RandomPoint ¶
func RandomPoint() *Point
func (*Point) AddPedersen ¶
aA + bB
func (*Point) AddPedersenCached ¶
func (p *Point) AddPedersenCached(a *Scalar, APreCompute [8]C25519.CachedGroupElement, b *Scalar, BPreCompute [8]C25519.CachedGroupElement) *Point
func (*Point) InvertScalarMultBase ¶
func (Point) IsIdentity ¶
func (Point) MarshalText ¶
func (*Point) MultiScalarMult ¶
func (*Point) MultiScalarMultCached ¶
func (p *Point) MultiScalarMultCached(scalarLs []*Scalar, pointPreComputedLs [][8]C25519.CachedGroupElement) *Point
func (Point) PointValid ¶
func (*Point) ScalarMultBase ¶
does a * G where a is a scalar and G is the curve basepoint
func (Point) ToBytes ¶
func (p Point) ToBytes() [Ed25519KeySize]byte
type Scalar ¶
type Scalar struct {
// contains filtered or unexported fields
}
func HashToScalar ¶
func RandomScalar ¶
func RandomScalar() *Scalar
func (*Scalar) FromBytesS ¶
func (*Scalar) FromUint64 ¶
func (Scalar) MarshalText ¶
func (*Scalar) ScalarValid ¶
func (*Scalar) SetKeyUnsafe ¶
Should not use this if you don't know what you are doing
func (Scalar) ToBytes ¶
func (sc Scalar) ToBytes() [Ed25519KeySize]byte
func (*Scalar) ToUint64Little ¶
Click to show internal directories.
Click to hide internal directories.