crypto

package
v0.0.0-...-7ae82dc Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CosiSignature

type CosiSignature struct {
	Signature Signature
	Mask      uint64
	// contains filtered or unexported fields
}

func CosiAggregateCommitment

func CosiAggregateCommitment(randoms map[int]*Key) (*CosiSignature, error)

func (*CosiSignature) AggregatePublicKey

func (c *CosiSignature) AggregatePublicKey(publics []*Key) (*Key, error)

func (*CosiSignature) AggregateResponse

func (c *CosiSignature) AggregateResponse(publics []*Key, responses map[int]*[32]byte, message []byte, strict bool) error

func (*CosiSignature) Challenge

func (c *CosiSignature) Challenge(publics []*Key, message []byte) ([32]byte, error)

func (*CosiSignature) FullVerify

func (c *CosiSignature) FullVerify(publics []*Key, threshold int, message []byte) bool

func (*CosiSignature) Keys

func (c *CosiSignature) Keys() []int

func (*CosiSignature) Mark

func (c *CosiSignature) Mark(i int) error

func (CosiSignature) MarshalJSON

func (c CosiSignature) MarshalJSON() ([]byte, error)

func (*CosiSignature) Response

func (c *CosiSignature) Response(privateKey, random *Key, publics []*Key, message []byte) ([32]byte, error)

func (CosiSignature) String

func (c CosiSignature) String() string

func (*CosiSignature) ThresholdVerify

func (c *CosiSignature) ThresholdVerify(threshold int) bool

func (*CosiSignature) UnmarshalJSON

func (c *CosiSignature) UnmarshalJSON(b []byte) error

func (*CosiSignature) VerifyResponse

func (c *CosiSignature) VerifyResponse(publics []*Key, signer int, s *[32]byte, message []byte) error

type Hash

type Hash [32]byte

func HashFromString

func HashFromString(src string) (Hash, error)

func NewHash

func NewHash(data []byte) Hash

func (Hash) ForNetwork

func (h Hash) ForNetwork(net Hash) Hash

func (Hash) HasValue

func (h Hash) HasValue() bool

func (Hash) MarshalJSON

func (h Hash) MarshalJSON() ([]byte, error)

func (Hash) String

func (h Hash) String() string

func (*Hash) UnmarshalJSON

func (h *Hash) UnmarshalJSON(b []byte) error

type Key

type Key [32]byte

func CosiCommit

func CosiCommit(randReader io.Reader) *Key

func DeriveGhostPrivateKey

func DeriveGhostPrivateKey(R, a, b *Key, outputIndex uint64) *Key

func DeriveGhostPublicKey

func DeriveGhostPublicKey(r, A, B *Key, outputIndex uint64) *Key

func KeyAddPub

func KeyAddPub(pub1, pub2 *Key) *Key

func KeyFromString

func KeyFromString(s string) (Key, error)

func KeyMultPubPriv

func KeyMultPubPriv(pub, priv *Key) *Key

func NewKeyFromSeed

func NewKeyFromSeed(seed []byte) Key

func ViewGhostOutputKey

func ViewGhostOutputKey(P, a, R *Key, outputIndex uint64) *Key

func (Key) CheckKey

func (k Key) CheckKey() bool

func (Key) CheckScalar

func (k Key) CheckScalar() bool

func (Key) DeterministicHashDerive

func (k Key) DeterministicHashDerive() Key

func (Key) HasValue

func (k Key) HasValue() bool

func (Key) HashScalar

func (k Key) HashScalar() *[32]byte

func (Key) MarshalJSON

func (k Key) MarshalJSON() ([]byte, error)

func (*Key) MultScalar

func (k *Key) MultScalar(outputIndex uint64) *Key

func (Key) Public

func (k Key) Public() Key

func (*Key) Sign

func (privateKey *Key) Sign(message []byte) Signature

func (Key) String

func (k Key) String() string

func (*Key) UnmarshalJSON

func (k *Key) UnmarshalJSON(b []byte) error

func (*Key) Verify

func (publicKey *Key) Verify(message []byte, sig Signature) bool

func (*Key) VerifyWithChallenge

func (publicKey *Key) VerifyWithChallenge(message []byte, sig Signature, hReduced [32]byte) bool

type Signature

type Signature [64]byte

func (Signature) MarshalJSON

func (s Signature) MarshalJSON() ([]byte, error)

func (*Signature) R

func (s *Signature) R() []byte

func (*Signature) S

func (s *Signature) S() []byte

func (Signature) String

func (s Signature) String() string

func (*Signature) UnmarshalJSON

func (s *Signature) UnmarshalJSON(b []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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