cryptolib

package
v0.7.0-alpha.12 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 14 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 PointFromBytes added in v1.0.3

func PointFromBytes(data []byte, factory interface{ Point() kyber.Point }) (point kyber.Point, err error)

func PointFromReader added in v1.0.3

func PointFromReader(rr *rwutil.Reader, factory interface{ Point() kyber.Point }) (point kyber.Point)

func PointToWriter added in v1.0.3

func PointToWriter(ww *rwutil.Writer, point kyber.Point)

func ScalarFromBytes added in v1.0.3

func ScalarFromBytes(data []byte, factory interface{ Scalar() kyber.Scalar }) (scalar kyber.Scalar, err error)

func ScalarFromReader added in v1.0.3

func ScalarFromReader(rr *rwutil.Reader, factory interface{ Scalar() kyber.Scalar }) (scalar kyber.Scalar)

func ScalarToWriter added in v1.0.3

func ScalarToWriter(ww *rwutil.Writer, scalar kyber.Scalar)

func SignatureFromBytes

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

Types

type KeyPair

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

func KeyPairFromPrivateKey added in v1.0.3

func KeyPairFromPrivateKey(privateKey *PrivateKey) *KeyPair

func KeyPairFromSeed added in v1.0.3

func KeyPairFromSeed(seed Seed) *KeyPair

func NewKeyPair

func NewKeyPair() *KeyPair

NewKeyPair creates a new key pair with a randomly generated seed

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) Read added in v1.0.3

func (k *KeyPair) Read(r io.Reader) error

func (*KeyPair) Verify

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

func (*KeyPair) Write added in v1.0.3

func (k *KeyPair) Write(w io.Writer) error

type PrivateKey

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

func NewPrivateKey

func NewPrivateKey() *PrivateKey

func PrivateKeyFromBytes added in v1.0.3

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

func PrivateKeyFromSeed added in v1.0.3

func PrivateKeyFromSeed(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) Read added in v1.0.3

func (pkT *PrivateKey) Read(r io.Reader) error

func (*PrivateKey) Sign

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

func (*PrivateKey) String

func (pkT *PrivateKey) String() string

func (*PrivateKey) Write added in v1.0.3

func (pkT *PrivateKey) Write(w io.Writer) error

type PublicKey

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

func NewEmptyPublicKey

func NewEmptyPublicKey() *PublicKey

func PublicKeyFromBytes added in v1.0.3

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

func PublicKeyFromString added in v1.0.3

func PublicKeyFromString(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) Read added in v1.0.3

func (pkT *PublicKey) Read(r io.Reader) error

func (*PublicKey) String

func (pkT *PublicKey) String() string

func (*PublicKey) Verify

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

func (*PublicKey) Write added in v1.0.3

func (pkT *PublicKey) Write(w io.Writer) error

type PublicKeyKey

type PublicKeyKey [PublicKeySize]byte

type Seed

type Seed [SeedSize]byte

func NewSeed

func NewSeed() (ret Seed)

func SeedFromBytes added in v1.0.3

func SeedFromBytes(data []byte) (ret 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