Documentation ¶
Index ¶
- Constants
- func SetEKeyFactory(f EKeyFactory)
- func SetHashFunc(h HashFunc)
- func SetKeyFactory(f KeyFactory)
- type Commitment
- type CosiSignature
- func (c *CosiSignature) AggregateSignature(node int, sig *Signature) error
- func (c *CosiSignature) Challenge(allPublics []PublicKey, message []byte) ([32]byte, error)
- func (c *CosiSignature) DumpSignatureResponse(sig *Signature) *Response
- func (c CosiSignature) Dumps() []byte
- func (c *CosiSignature) FullVerify(publics []PublicKey, threshold int, message []byte) bool
- func (c *CosiSignature) KeyIndex(node int) int
- func (c *CosiSignature) Keys() []int
- func (c *CosiSignature) LoadResponseSignature(commitment *Commitment, response *Response) *Signature
- func (c *CosiSignature) Loads(data []byte) (rest []byte, err error)
- func (c *CosiSignature) Mark(i int) error
- func (c *CosiSignature) MarkSignature(i int) error
- func (c *CosiSignature) SignatureAggregated(i int) bool
- func (c CosiSignature) String() string
- func (c *CosiSignature) ThresholdVerify(threshold int) bool
- type EKey
- func (k EKey) AsPrivateKey() (EPrivateKey, error)
- func (k EKey) AsPublicKey() (EPublicKey, error)
- func (k EKey) MarshalJSON() ([]byte, error)
- func (k *EKey) Scan(value interface{}) error
- func (k EKey) String() string
- func (k *EKey) UnmarshalJSON(b []byte) error
- func (k EKey) Value() (driver.Value, error)
- type EKeyFactory
- type EPrivateKey
- type EPublicKey
- type Hash
- type HashFunc
- type Key
- func (k Key) AsPrivateKey() (PrivateKey, error)
- func (k Key) AsPublicKey() (PublicKey, error)
- func (k Key) HasValue() bool
- func (k Key) MarshalJSON() ([]byte, error)
- func (k *Key) Scan(value interface{}) error
- func (k Key) String() string
- func (k *Key) UnmarshalJSON(b []byte) error
- func (k Key) Value() (driver.Value, error)
- type KeyFactory
- type PrivateKey
- type PublicKey
- type Response
- type Signature
Constants ¶
View Source
const ( KeySize = 32 EKeySize = 33 ResponseSize = 32 )
Variables ¶
This section is empty.
Functions ¶
func SetEKeyFactory ¶ added in v0.2.1
func SetEKeyFactory(f EKeyFactory)
func SetHashFunc ¶ added in v0.2.1
func SetHashFunc(h HashFunc)
func SetKeyFactory ¶ added in v0.2.1
func SetKeyFactory(f KeyFactory)
Types ¶
type Commitment ¶ added in v0.2.1
type Commitment Key
type CosiSignature ¶
type CosiSignature struct { Signatures []Signature `json:"signatures"` Mask uint64 `json:"mask"` SignatureMask uint64 `json:"-" msgpack:"-"` }
func CosiAggregateCommitments ¶ added in v0.2.1
func CosiAggregateCommitments(commitments map[int]*Commitment) (*CosiSignature, error)
func (*CosiSignature) AggregateSignature ¶ added in v0.2.1
func (c *CosiSignature) AggregateSignature(node int, sig *Signature) error
func (*CosiSignature) Challenge ¶
func (c *CosiSignature) Challenge(allPublics []PublicKey, message []byte) ([32]byte, error)
func (*CosiSignature) DumpSignatureResponse ¶ added in v0.2.1
func (c *CosiSignature) DumpSignatureResponse(sig *Signature) *Response
func (CosiSignature) Dumps ¶ added in v0.2.1
func (c CosiSignature) Dumps() []byte
func (*CosiSignature) FullVerify ¶
func (c *CosiSignature) FullVerify(publics []PublicKey, threshold int, message []byte) bool
func (*CosiSignature) KeyIndex ¶ added in v0.2.1
func (c *CosiSignature) KeyIndex(node int) int
func (*CosiSignature) Keys ¶
func (c *CosiSignature) Keys() []int
func (*CosiSignature) LoadResponseSignature ¶ added in v0.2.1
func (c *CosiSignature) LoadResponseSignature(commitment *Commitment, response *Response) *Signature
func (*CosiSignature) Loads ¶ added in v0.2.1
func (c *CosiSignature) Loads(data []byte) (rest []byte, err error)
func (*CosiSignature) Mark ¶
func (c *CosiSignature) Mark(i int) error
func (*CosiSignature) MarkSignature ¶ added in v0.2.1
func (c *CosiSignature) MarkSignature(i int) error
func (*CosiSignature) SignatureAggregated ¶ added in v0.2.1
func (c *CosiSignature) SignatureAggregated(i int) bool
func (CosiSignature) String ¶
func (c CosiSignature) String() string
func (*CosiSignature) ThresholdVerify ¶
func (c *CosiSignature) ThresholdVerify(threshold int) bool
type EKey ¶ added in v0.2.1
func EKeyFromString ¶ added in v0.2.1
func (EKey) AsPrivateKey ¶ added in v0.2.1
func (k EKey) AsPrivateKey() (EPrivateKey, error)
func (EKey) AsPublicKey ¶ added in v0.2.1
func (k EKey) AsPublicKey() (EPublicKey, error)
func (EKey) MarshalJSON ¶ added in v0.2.1
func (*EKey) Scan ¶ added in v0.2.1
Scan implements the sql.Scanner interface for database deserialization.
func (*EKey) UnmarshalJSON ¶ added in v0.2.1
type EKeyFactory ¶ added in v0.2.1
type EKeyFactory interface { EPrivateKeyFromSeed(seed []byte) (EPrivateKey, error) EPrivateKeyFromKey(k EKey) (EPrivateKey, error) EPublicKeyFromKey(k EKey) (EPublicKey, error) }
type EPrivateKey ¶ added in v0.2.1
type EPrivateKey interface { String() string EKey() EKey EPublic() EPublicKey Sign(message []byte) (*Signature, error) Decrypt(encryptedText []byte) ([]byte, error) }
func EPrivateKeyFromSeed ¶ added in v0.2.1
func EPrivateKeyFromSeed(seed []byte) (EPrivateKey, error)
func NewEPrivateKey ¶ added in v0.2.1
func NewEPrivateKey(randReader io.Reader) EPrivateKey
type EPublicKey ¶ added in v0.2.1
type Hash ¶
type Hash [32]byte
func HashFromString ¶
func (Hash) ForNetwork ¶
func (Hash) MarshalJSON ¶
func (*Hash) Scan ¶ added in v0.0.7
Scan implements the sql.Scanner interface for database deserialization.
func (*Hash) UnmarshalJSON ¶
type Key ¶
func KeyFromString ¶
func (Key) AsPrivateKey ¶ added in v0.2.1
func (k Key) AsPrivateKey() (PrivateKey, error)
func (Key) AsPublicKey ¶ added in v0.2.1
func (Key) MarshalJSON ¶
func (*Key) Scan ¶ added in v0.0.7
Scan implements the sql.Scanner interface for database deserialization.
func (*Key) UnmarshalJSON ¶
type KeyFactory ¶ added in v0.2.1
type KeyFactory interface { PrivateKeyFromSeed(seed []byte) (PrivateKey, error) PrivateKeyFromKey(k Key) (PrivateKey, error) PublicKeyFromKey(k Key) (PublicKey, error) // cosi CosiDumps(cosi *CosiSignature) (data []byte) CosiLoads(cosi *CosiSignature, data []byte) (rest []byte, err error) CosiAggregateCommitments(cosi *CosiSignature, commitments map[int]*Commitment) error CosiChallenge(cosi *CosiSignature, publics map[int]PublicKey, message []byte) ([32]byte, error) CosiAggregateSignature(cosi *CosiSignature, keyIndex int, sig *Signature) error CosiFullVerify(publics map[int]PublicKey, message []byte, sig *CosiSignature) bool UpdateSignatureCommitment(sig *Signature, commitment *Commitment) DumpSignatureResponse(sig *Signature) *Response LoadResponseSignature(cosi *CosiSignature, commitment *Commitment, response *Response) *Signature }
type PrivateKey ¶ added in v0.2.1
type PrivateKey interface { String() string Key() Key Public() PublicKey AddPrivate(p PrivateKey) PrivateKey ScalarMult(pub PublicKey) PublicKey Sign(message []byte) (*Signature, error) SignWithChallenge(random PrivateKey, message []byte, hReduced [32]byte) (*Signature, error) }
func DeriveGhostPrivateKey ¶
func DeriveGhostPrivateKey(R PublicKey, a, b PrivateKey, outputIndex uint64) PrivateKey
func NewPrivateKey ¶ added in v0.2.1
func NewPrivateKey(randReader io.Reader) PrivateKey
func PrivateKeyFromSeed ¶ added in v0.2.1
func PrivateKeyFromSeed(seed []byte) PrivateKey
func PrivateKeyFromString ¶ added in v0.2.1
func PrivateKeyFromString(s string) (PrivateKey, error)
type PublicKey ¶ added in v0.2.1
type PublicKey interface { String() string Key() Key AddPublic(p PublicKey) PublicKey SubPublic(p PublicKey) PublicKey ScalarHash(outputIndex uint64) PrivateKey DeterministicHashDerive() PrivateKey Challenge(R PublicKey, message []byte) [32]byte Verify(message []byte, sig *Signature) bool VerifyWithChallenge(message []byte, sig *Signature, hReduced [32]byte) bool }
func DeriveGhostPublicKey ¶
func DeriveGhostPublicKey(r PrivateKey, A, B PublicKey, outputIndex uint64) PublicKey
func PublicKeyFromString ¶ added in v0.2.1
func ViewGhostOutputKey ¶
func ViewGhostOutputKey(R, P PublicKey, a PrivateKey, outputIndex uint64) PublicKey
type Response ¶ added in v0.2.1
type Response [ResponseSize]byte
type Signature ¶
type Signature [64]byte
func (Signature) MarshalJSON ¶
func (*Signature) UnmarshalJSON ¶
func (*Signature) WithCommitment ¶ added in v0.2.1
func (s *Signature) WithCommitment(commitment *Commitment)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.