cryptolib

package
v0.5.0-alpha.7 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 12 Imported by: 8

Documentation

Index

Constants

View Source
const PrivateKeySize = ed25519.PrivateKeySize
View Source
const PublicKeySize = ed25519.PublicKeySize
View Source
const (
	SeedSize = ed25519.SeedSize
)
View Source
const SignatureSize = ed25519.SignatureSize

Variables

This section is empty.

Functions

func SignatureFromBytes

func SignatureFromBytes(bytes []byte) (result [SignatureSize]byte, consumedBytes int, err error)

Types

type KeyPair

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

func NewKeyPair

func NewKeyPair() *KeyPair

NewKeyPair creates a new key pair with a randomly generated seed

func NewKeyPairFromPrivateKey

func NewKeyPairFromPrivateKey(privateKey *PrivateKey) *KeyPair

func NewKeyPairFromSeed

func NewKeyPairFromSeed(seed Seed) *KeyPair

func (*KeyPair) Address

func (k *KeyPair) Address() *iotago.Ed25519Address

func (*KeyPair) AsAddressSigner

func (k *KeyPair) AsAddressSigner() iotago.AddressSigner

func (*KeyPair) GetPrivateKey

func (k *KeyPair) GetPrivateKey() *PrivateKey

func (*KeyPair) GetPublicKey

func (k *KeyPair) GetPublicKey() *PublicKey

func (*KeyPair) IsValid

func (k *KeyPair) IsValid() bool

func (*KeyPair) Verify

func (k *KeyPair) Verify(message, sig []byte) bool

type PrivateKey

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

func NewPrivateKey

func NewPrivateKey() *PrivateKey

func NewPrivateKeyFromBytes

func NewPrivateKeyFromBytes(privateKeyBytes []byte) (*PrivateKey, error)

func NewPrivateKeyFromSeed

func NewPrivateKeyFromSeed(seed Seed) *PrivateKey

func (*PrivateKey) AddressKeys

func (pkT *PrivateKey) AddressKeys(addr iotago.Address) iotago.AddressKeys

func (*PrivateKey) AddressKeysForEd25519Address

func (pkT *PrivateKey) AddressKeysForEd25519Address(addr *iotago.Ed25519Address) iotago.AddressKeys

func (*PrivateKey) AsBytes

func (pkT *PrivateKey) AsBytes() []byte

func (*PrivateKey) AsKyberKeyPair added in v1.0.3

func (pkT *PrivateKey) AsKyberKeyPair() (*key.Pair, error)

func (*PrivateKey) AsStdKey

func (pkT *PrivateKey) AsStdKey() ed25519.PrivateKey

func (*PrivateKey) Clone added in v1.0.3

func (pkT *PrivateKey) Clone() *PrivateKey

func (*PrivateKey) Public

func (pkT *PrivateKey) Public() *PublicKey

func (*PrivateKey) Sign

func (pkT *PrivateKey) Sign(message []byte) []byte

func (*PrivateKey) String

func (pkT *PrivateKey) String() string

type PublicKey

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

func NewEmptyPublicKey

func NewEmptyPublicKey() *PublicKey

func NewPublicKeyFromBytes

func NewPublicKeyFromBytes(publicKeyBytes []byte) (*PublicKey, error)

func NewPublicKeyFromString

func NewPublicKeyFromString(s string) (publicKey *PublicKey, err error)

func (*PublicKey) AsBytes

func (pkT *PublicKey) AsBytes() []byte

func (*PublicKey) AsEd25519Address

func (pkT *PublicKey) AsEd25519Address() *iotago.Ed25519Address

func (*PublicKey) AsKey

func (pkT *PublicKey) AsKey() PublicKeyKey

func (*PublicKey) AsKyberPoint added in v1.0.3

func (pkT *PublicKey) AsKyberPoint() (kyber.Point, error)

func (*PublicKey) Clone added in v1.0.3

func (pkT *PublicKey) Clone() *PublicKey

func (*PublicKey) Equals

func (pkT *PublicKey) Equals(other *PublicKey) bool

func (*PublicKey) String

func (pkT *PublicKey) String() string

func (*PublicKey) Verify

func (pkT *PublicKey) Verify(message, sig []byte) bool

type PublicKeyKey

type PublicKeyKey [PublicKeySize]byte

type Seed

type Seed [SeedSize]byte

func NewSeed

func NewSeed() Seed

func NewSeedFromBytes

func NewSeedFromBytes(seedData []byte) Seed

func (*Seed) SubSeed

func (seed *Seed) SubSeed(n uint64) Seed

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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