bls

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MPL-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToKeystore

func ToKeystore(k *Key, password string) ([]byte, error)

Types

type Key

type Key struct {
	Id  string
	Pub *PublicKey
	Prv *SecretKey
}

Key is a reference to a key in the keymanager

func FromKeystore

func FromKeystore(content []byte, password string) (*Key, error)

func NewKeyFromPriv

func NewKeyFromPriv(priv []byte) (*Key, error)

func NewRandomKey

func NewRandomKey() *Key

func (*Key) Equal

func (k *Key) Equal(kk *Key) bool

func (*Key) Marshal

func (k *Key) Marshal() ([]byte, error)

func (*Key) PubKey

func (k *Key) PubKey() (out [48]byte)

func (*Key) Sign

func (k *Key) Sign(root [32]byte) ([96]byte, error)

func (*Key) Unmarshal

func (k *Key) Unmarshal(data []byte) error

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

PublicKey is a Bls public key

func (*PublicKey) Deserialize

func (p *PublicKey) Deserialize(buf []byte) error

func (*PublicKey) Serialize

func (p *PublicKey) Serialize() (res [48]byte)

type SecretKey

type SecretKey struct {
	// contains filtered or unexported fields
}

SecretKey is a Bls secret key

func RandomKey

func RandomKey() *SecretKey

func (*SecretKey) GetPublicKey

func (s *SecretKey) GetPublicKey() *PublicKey

func (*SecretKey) Marshal

func (s *SecretKey) Marshal() ([]byte, error)

func (*SecretKey) Sign

func (s *SecretKey) Sign(msg []byte) (*Signature, error)

func (*SecretKey) Unmarshal

func (s *SecretKey) Unmarshal(data []byte) error

type Signature

type Signature struct {
	// contains filtered or unexported fields
}

Signature is a Bls signature

func (*Signature) Deserialize

func (s *Signature) Deserialize(buf []byte) error

func (*Signature) Serialize

func (s *Signature) Serialize() (buf [96]byte)

func (*Signature) VerifyByte

func (s *Signature) VerifyByte(pub *PublicKey, msg []byte) (bool, error)

Jump to

Keyboard shortcuts

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