hypercorecrypto

package module
v0.0.0-...-6a26b94 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 6 Imported by: 0

README

go-hypercore-crypto

Documentation

Index

Constants

View Source
const (
	LeafType   = byte(0)
	ParentType = byte(1)
	RootType   = byte(2)
	Hypercore  = "hypercore"
)

Variables

This section is empty.

Functions

func Data

func Data(data []byte) []byte

func DiscoveryKey

func DiscoveryKey(publicKey []byte) []byte

func Namespace

func Namespace(name []byte, count int) [][]byte

func Parent

func Parent(a, b []byte, aSize, bSize uint64) []byte

func RandomBytes

func RandomBytes(n int) []byte

func Sign

func Sign(message, privateKey []byte) []byte

func Tree

func Tree(roots [][]byte, out []byte) []byte

func ValidateKeyPair

func ValidateKeyPair(keyPair KeyPair) bool

func Verify

func Verify(message, signature, publicKey []byte) bool

func WriteUvarint

func WriteUvarint(w io.Writer, x uint64)

Types

type KeyPair

type KeyPair struct {
	PublicKey  []byte
	PrivateKey []byte
}

func KeyPairFromSeed

func KeyPairFromSeed(seed []byte) KeyPair

func NewKeyPair

func NewKeyPair() KeyPair

Jump to

Keyboard shortcuts

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