crypto

package
v0.0.0-...-83f9183 Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: Unlicense Imports: 3 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ZeroHash

func ZeroHash(cs CryptoService) core.Hash

Types

type CryptoService

type CryptoService interface {
	GetSize() int
	Hash(msg []byte) (core.Hash, error)
	Raw(h Hashable, t RawType) (core.Hash, []byte, error)
	Sign(p account.Key, s Signable) error
	Verify(s Signable) (bool, error)
}

type Hashable

type Hashable interface {
	core.Binariable
	Raw(t RawType) ([]byte, error)

	GetHash() core.Hash
	SetHash(h core.Hash)
}

type RawType

type RawType uint32
const (
	RawBinary RawType = iota
	RawIgnoreVariableFields
	RawIgnoreSigningFields
	RawIgnoreContent
)

type Signable

type Signable interface {
	Hashable

	GetAccount() core.Address

	GetSignature() core.Signature
	SetSignature(s core.Signature)

	SetPublicKey(p core.PublicKey)
	GetPublicKey() core.PublicKey
}

Jump to

Keyboard shortcuts

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