Documentation ¶
Index ¶
- func AggregateVerify(sig *Signature, publics []*Key, signers []int, message []byte) error
- func BatchVerify(msg []byte, keys []*Key, sigs []*Signature) bool
- func HashScalar(k *edwards25519.Point, outputIndex uint64) *edwards25519.Scalar
- func KeyMultPubPriv(pub, priv *Key) *edwards25519.Point
- type BatchVerifier
- type CosiSignature
- func (c *CosiSignature) AggregateResponse(publics []*Key, responses map[int]*[32]byte, message []byte, strict bool) error
- func (c *CosiSignature) Challenge(publics []*Key, message []byte) (*edwards25519.Scalar, error)
- func (c *CosiSignature) FullVerify(publics []*Key, threshold int, message []byte) error
- func (c *CosiSignature) Keys() []int
- func (c CosiSignature) MarshalJSON() ([]byte, error)
- func (c *CosiSignature) Response(privateKey, random *Key, publics []*Key, message []byte) (*[32]byte, error)
- func (c CosiSignature) String() string
- func (c *CosiSignature) ThresholdVerify(threshold int) bool
- func (c *CosiSignature) UnmarshalJSON(b []byte) error
- func (c *CosiSignature) VerifyResponse(publics []*Key, signer int, s *[32]byte, message []byte) error
- type Hash
- type Key
- func CosiCommit(randReader io.Reader) *Key
- func DeriveGhostPrivateKey(R, a, b *Key, outputIndex uint64) *Key
- func DeriveGhostPublicKey(r, A, B *Key, outputIndex uint64) *Key
- func KeyFromString(s string) (Key, error)
- func NewKeyFromSeed(seed []byte) Key
- func ViewGhostOutputKey(P, a, R *Key, outputIndex uint64) *Key
- func (k Key) CheckKey() bool
- func (k Key) DeterministicHashDerive() Key
- func (k Key) HasValue() bool
- func (k Key) MarshalJSON() ([]byte, error)
- func (k Key) Public() Key
- func (privateKey *Key) Sign(message []byte) Signature
- func (k Key) String() string
- func (k *Key) UnmarshalJSON(b []byte) error
- func (publicKey *Key) Verify(message []byte, sig Signature) bool
- func (publicKey *Key) VerifyWithChallenge(message []byte, sig Signature, a *edwards25519.Scalar) bool
- type Signature
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AggregateVerify ¶ added in v0.12.18
func BatchVerify ¶ added in v0.12.0
func HashScalar ¶ added in v0.9.8
func HashScalar(k *edwards25519.Point, outputIndex uint64) *edwards25519.Scalar
func KeyMultPubPriv ¶ added in v0.5.0
func KeyMultPubPriv(pub, priv *Key) *edwards25519.Point
Types ¶
type BatchVerifier ¶ added in v0.12.1
type BatchVerifier struct {
// contains filtered or unexported fields
}
BatchVerifier accumulates batch entries with Add, before performing batch verification with Verify.
func NewBatchVerifier ¶ added in v0.12.1
func NewBatchVerifier() BatchVerifier
NewBatchVerifier creates an empty BatchVerifier.
func (*BatchVerifier) Add ¶ added in v0.12.1
func (v *BatchVerifier) Add(publicKey *Key, message, sig []byte)
Add adds a (public key, message, sig) triple to the current batch.
func (*BatchVerifier) Verify ¶ added in v0.12.1
func (v *BatchVerifier) Verify() bool
Verify checks all entries in the current batch, returning true if all entries are valid and false if any one entry is invalid.
If a failure arises it is unknown which entry failed, the caller must verify each entry individually.
Calling Verify on an empty batch returns false.
type CosiSignature ¶ added in v0.5.0
type CosiSignature struct { Signature Signature Mask uint64 // contains filtered or unexported fields }
func CosiAggregateCommitment ¶ added in v0.5.0
func CosiAggregateCommitment(randoms map[int]*Key) (*CosiSignature, error)
func (*CosiSignature) AggregateResponse ¶ added in v0.5.0
func (*CosiSignature) Challenge ¶ added in v0.5.0
func (c *CosiSignature) Challenge(publics []*Key, message []byte) (*edwards25519.Scalar, error)
func (*CosiSignature) FullVerify ¶ added in v0.5.0
func (c *CosiSignature) FullVerify(publics []*Key, threshold int, message []byte) error
func (*CosiSignature) Keys ¶ added in v0.5.0
func (c *CosiSignature) Keys() []int
func (CosiSignature) MarshalJSON ¶ added in v0.5.0
func (c CosiSignature) MarshalJSON() ([]byte, error)
func (CosiSignature) String ¶ added in v0.5.0
func (c CosiSignature) String() string
func (*CosiSignature) ThresholdVerify ¶ added in v0.5.0
func (c *CosiSignature) ThresholdVerify(threshold int) bool
func (*CosiSignature) UnmarshalJSON ¶ added in v0.5.0
func (c *CosiSignature) UnmarshalJSON(b []byte) error
func (*CosiSignature) VerifyResponse ¶ added in v0.5.0
type Hash ¶
type Hash [32]byte
func Blake3Hash ¶ added in v0.14.0
func HashFromString ¶
func (Hash) ForNetwork ¶
func (Hash) MarshalJSON ¶
func (*Hash) UnmarshalJSON ¶
type Key ¶
type Key [32]byte
func CosiCommit ¶ added in v0.5.0
func DeriveGhostPrivateKey ¶
func DeriveGhostPublicKey ¶
func KeyFromString ¶ added in v0.5.10
func NewKeyFromSeed ¶
func ViewGhostOutputKey ¶
func (Key) DeterministicHashDerive ¶
func (Key) MarshalJSON ¶
func (*Key) UnmarshalJSON ¶
func (*Key) VerifyWithChallenge ¶ added in v0.5.0
type Signature ¶
type Signature [64]byte
func (Signature) MarshalJSON ¶
func (*Signature) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.