crypto

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SigTypeUnknown = SigType(math.MaxUint8)

	SigTypeSecp256k1 = SigType(iota)
	SigTypeBLS

	SigTypeDelegated
	SigTypeMultiPqc

	SigTypeFalcon512
	SigTypeFalcon1024
	SigTypeDilithium3
	SigTypeDilithium5
)
View Source
const MultiPqcSigLen = 897 + 692 + 1952 + 3293 + 20

Falcon1024CryptoPkBytes + Falcon1024CryptoSignBytes + Dilithium5CryptoPkBytes + Dilithium5CryptoSignBytes+other

View Source
const SignatureMaxLength = 10000

Variables

This section is empty.

Functions

This section is empty.

Types

type DomainSeparationTag

type DomainSeparationTag int64

Specifies a domain for randomness generation.

const (
	DomainSeparationTag_TicketProduction DomainSeparationTag = 1 + iota
	DomainSeparationTag_ElectionProofProduction
	DomainSeparationTag_WinningPoStChallengeSeed
	DomainSeparationTag_WindowedPoStChallengeSeed
	DomainSeparationTag_SealRandomness
	DomainSeparationTag_InteractiveSealChallengeSeed
	DomainSeparationTag_WindowedPoStDeadlineAssignment
	DomainSeparationTag_MarketDealCronSeed
	DomainSeparationTag_PoStChainCommit
)

type PqcSignature

type PqcSignature struct {
	Type SigType
	Data []byte
}

func (*PqcSignature) MarshalCBOR

func (t *PqcSignature) MarshalCBOR(w io.Writer) error

func (*PqcSignature) UnmarshalCBOR

func (t *PqcSignature) UnmarshalCBOR(r io.Reader) (err error)

type SigType

type SigType byte

func GetTypeByName

func GetTypeByName(name string) SigType

func (SigType) Name

func (t SigType) Name() (string, error)

type SignPQCCert

type SignPQCCert struct {
	Pubkeys []SignPqcCertPubkey
	Version uint8
}

func (*SignPQCCert) MarshalCBOR

func (t *SignPQCCert) MarshalCBOR(w io.Writer) error

func (*SignPQCCert) UnmarshalCBOR

func (t *SignPQCCert) UnmarshalCBOR(r io.Reader) (err error)

type SignPqcCertPubkey

type SignPqcCertPubkey struct {
	Typ    string
	Pubkey []byte
}

func (*SignPqcCertPubkey) MarshalCBOR

func (t *SignPqcCertPubkey) MarshalCBOR(w io.Writer) error

func (*SignPqcCertPubkey) UnmarshalCBOR

func (t *SignPqcCertPubkey) UnmarshalCBOR(r io.Reader) (err error)

type Signature

type Signature struct {
	Type          SigType
	Data          []byte
	PqcSignatures []PqcSignature
	PqcCert       SignPQCCert
}

func (*Signature) ChainLength

func (m *Signature) ChainLength() int

func (*Signature) Equals

func (s *Signature) Equals(o *Signature) bool

func (*Signature) Get

func (s *Signature) Get(tp SigType) ([]byte, error)

func (*Signature) MarshalCBOR

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

func (*Signature) Serialize

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

func (*Signature) Set

func (s *Signature) Set(tp SigType, data []byte) error

func (*Signature) UnmarshalCBOR

func (t *Signature) UnmarshalCBOR(r io.Reader) (err error)

Jump to

Keyboard shortcuts

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