crypto

package
v0.0.0-...-85922c0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SignatureMaxLength = 130 //(secp sign len) 65*2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SigType

type SigType = byte
const (
	TypeSecp256k1 SigType = iota
	TypeED25519
	TypeMutil

	TypeUnknown = 255
)

type Signature

type Signature struct {
	SigType SigType
	Data    []byte
}

func DeserializeSignature

func DeserializeSignature(data []byte) (*Signature, error)

DeserializeSignature deserializes binary data in cbor format into Signature, and returns an error if the data format is incorrect

func (*Signature) MarshalCBOR

func (s *Signature) MarshalCBOR(w io.Writer) error

func (*Signature) Serialize

func (s *Signature) Serialize() ([]byte, error)

Serialize Signature in the cbor format

func (*Signature) String

func (s *Signature) String() string

func (*Signature) UnmarshalCBOR

func (s *Signature) UnmarshalCBOR(r io.Reader) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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