certificates

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: AGPL-3.0, ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInputRecordIsNil  = errors.New("input record is nil")
	ErrHashIsNil         = errors.New("hash is nil")
	ErrBlockHashIsNil    = errors.New("block hash is nil")
	ErrPreviousHashIsNil = errors.New("previous hash is nil")
	ErrSummaryValueIsNil = errors.New("summary value is nil")
)
View Source
var (
	ErrUnicitySealIsNil             = errors.New("unicity seal is nil")
	ErrSignerIsNil                  = errors.New("signer is nil")
	ErrUnicitySealHashIsNil         = errors.New("hash is nil")
	ErrUnicitySealPreviousHashIsNil = errors.New("previous hash is nil")
	ErrInvalidBlockNumber           = errors.New("invalid block number")
	ErrUnicitySealSignatureIsNil    = errors.New("no signatures")
	ErrRootValidatorInfoMissing     = errors.New("root validator info is missing")
	ErrUnknownSigner                = errors.New("unknown signer")
)
View Source
var ErrUnicityCertificateIsNil = errors.New("unicity certificate is nil")
View Source
var ErrUnicityTreeCertificateIsNil = errors.New("unicity tree certificate is nil")
View Source
var File_certificates_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type InputRecord

type InputRecord struct {

	// previously certified root hash
	PreviousHash []byte `protobuf:"bytes,1,opt,name=previous_hash,json=previousHash,proto3" json:"previous_hash,omitempty"`
	//  hash to be certified
	Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
	// hash of the block
	BlockHash []byte `protobuf:"bytes,3,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"`
	// summary value to certified
	SummaryValue []byte `protobuf:"bytes,4,opt,name=summary_value,json=summaryValue,proto3" json:"summary_value,omitempty"`
	// contains filtered or unexported fields
}

func (*InputRecord) AddToHasher

func (x *InputRecord) AddToHasher(hasher hash.Hash)

func (*InputRecord) Bytes

func (x *InputRecord) Bytes() []byte

func (*InputRecord) Descriptor deprecated

func (*InputRecord) Descriptor() ([]byte, []int)

Deprecated: Use InputRecord.ProtoReflect.Descriptor instead.

func (*InputRecord) GetBlockHash

func (x *InputRecord) GetBlockHash() []byte

func (*InputRecord) GetHash

func (x *InputRecord) GetHash() []byte

func (*InputRecord) GetPreviousHash

func (x *InputRecord) GetPreviousHash() []byte

func (*InputRecord) GetSummaryValue

func (x *InputRecord) GetSummaryValue() []byte

func (*InputRecord) IsValid

func (x *InputRecord) IsValid() error

func (*InputRecord) ProtoMessage

func (*InputRecord) ProtoMessage()

func (*InputRecord) ProtoReflect

func (x *InputRecord) ProtoReflect() protoreflect.Message

func (*InputRecord) Reset

func (x *InputRecord) Reset()

func (*InputRecord) String

func (x *InputRecord) String() string

type UnicityCertificate

type UnicityCertificate struct {
	InputRecord            *InputRecord            `protobuf:"bytes,1,opt,name=input_record,json=inputRecord,proto3" json:"input_record,omitempty"`
	UnicityTreeCertificate *UnicityTreeCertificate `` /* 129-byte string literal not displayed */
	UnicitySeal            *UnicitySeal            `protobuf:"bytes,3,opt,name=unicity_seal,json=unicitySeal,proto3" json:"unicity_seal,omitempty"`
	// contains filtered or unexported fields
}

func (*UnicityCertificate) AddToHasher

func (x *UnicityCertificate) AddToHasher(hasher hash.Hash)

func (*UnicityCertificate) Bytes added in v0.1.1

func (x *UnicityCertificate) Bytes() []byte

func (*UnicityCertificate) Descriptor deprecated

func (*UnicityCertificate) Descriptor() ([]byte, []int)

Deprecated: Use UnicityCertificate.ProtoReflect.Descriptor instead.

func (*UnicityCertificate) GetInputRecord

func (x *UnicityCertificate) GetInputRecord() *InputRecord

func (*UnicityCertificate) GetUnicitySeal

func (x *UnicityCertificate) GetUnicitySeal() *UnicitySeal

func (*UnicityCertificate) GetUnicityTreeCertificate

func (x *UnicityCertificate) GetUnicityTreeCertificate() *UnicityTreeCertificate

func (*UnicityCertificate) IsValid

func (x *UnicityCertificate) IsValid(verifiers map[string]crypto.Verifier, algorithm gocrypto.Hash, systemIdentifier, systemDescriptionHash []byte) error

func (*UnicityCertificate) ProtoMessage

func (*UnicityCertificate) ProtoMessage()

func (*UnicityCertificate) ProtoReflect

func (x *UnicityCertificate) ProtoReflect() protoreflect.Message

func (*UnicityCertificate) Reset

func (x *UnicityCertificate) Reset()

func (*UnicityCertificate) String

func (x *UnicityCertificate) String() string

type UnicitySeal

type UnicitySeal struct {
	RootChainRoundNumber uint64            `` /* 126-byte string literal not displayed */
	PreviousHash         []byte            `protobuf:"bytes,2,opt,name=previous_hash,json=previousHash,proto3" json:"previous_hash,omitempty"`
	Hash                 []byte            `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"`
	Signatures           map[string][]byte `` /* 161-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*UnicitySeal) AddToHasher

func (x *UnicitySeal) AddToHasher(hasher hash.Hash)

func (*UnicitySeal) Bytes

func (x *UnicitySeal) Bytes() []byte

func (*UnicitySeal) Descriptor deprecated

func (*UnicitySeal) Descriptor() ([]byte, []int)

Deprecated: Use UnicitySeal.ProtoReflect.Descriptor instead.

func (*UnicitySeal) GetHash

func (x *UnicitySeal) GetHash() []byte

func (*UnicitySeal) GetPreviousHash

func (x *UnicitySeal) GetPreviousHash() []byte

func (*UnicitySeal) GetRootChainRoundNumber

func (x *UnicitySeal) GetRootChainRoundNumber() uint64

func (*UnicitySeal) GetSignatures added in v0.1.1

func (x *UnicitySeal) GetSignatures() map[string][]byte

func (*UnicitySeal) IsValid

func (x *UnicitySeal) IsValid(verifiers map[string]crypto.Verifier) error

func (*UnicitySeal) ProtoMessage

func (*UnicitySeal) ProtoMessage()

func (*UnicitySeal) ProtoReflect

func (x *UnicitySeal) ProtoReflect() protoreflect.Message

func (*UnicitySeal) Reset

func (x *UnicitySeal) Reset()

func (*UnicitySeal) Sign

func (x *UnicitySeal) Sign(id string, signer crypto.Signer) error

func (*UnicitySeal) String

func (x *UnicitySeal) String() string

func (*UnicitySeal) Verify

func (x *UnicitySeal) Verify(verifiers map[string]crypto.Verifier) error

type UnicityTreeCertificate

type UnicityTreeCertificate struct {
	SystemIdentifier      []byte   `protobuf:"bytes,1,opt,name=system_identifier,json=systemIdentifier,proto3" json:"system_identifier,omitempty"`
	SiblingHashes         [][]byte `protobuf:"bytes,2,rep,name=sibling_hashes,json=siblingHashes,proto3" json:"sibling_hashes,omitempty"`
	SystemDescriptionHash []byte   `` /* 126-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*UnicityTreeCertificate) AddToHasher

func (x *UnicityTreeCertificate) AddToHasher(hasher hash.Hash)

func (*UnicityTreeCertificate) Bytes added in v0.1.1

func (x *UnicityTreeCertificate) Bytes() []byte

func (*UnicityTreeCertificate) Descriptor deprecated

func (*UnicityTreeCertificate) Descriptor() ([]byte, []int)

Deprecated: Use UnicityTreeCertificate.ProtoReflect.Descriptor instead.

func (*UnicityTreeCertificate) GetAuthPath

func (x *UnicityTreeCertificate) GetAuthPath(leafHash []byte, hashAlgorithm gocrypto.Hash) ([]byte, error)

func (*UnicityTreeCertificate) GetSiblingHashes

func (x *UnicityTreeCertificate) GetSiblingHashes() [][]byte

func (*UnicityTreeCertificate) GetSystemDescriptionHash

func (x *UnicityTreeCertificate) GetSystemDescriptionHash() []byte

func (*UnicityTreeCertificate) GetSystemIdentifier

func (x *UnicityTreeCertificate) GetSystemIdentifier() []byte

func (*UnicityTreeCertificate) IsValid

func (x *UnicityTreeCertificate) IsValid(systemIdentifier, systemDescriptionHash []byte) error

func (*UnicityTreeCertificate) ProtoMessage

func (*UnicityTreeCertificate) ProtoMessage()

func (*UnicityTreeCertificate) ProtoReflect

func (x *UnicityTreeCertificate) ProtoReflect() protoreflect.Message

func (*UnicityTreeCertificate) Reset

func (x *UnicityTreeCertificate) Reset()

func (*UnicityTreeCertificate) String

func (x *UnicityTreeCertificate) String() string

Jump to

Keyboard shortcuts

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