cryprotobuf

package
v1.25.1-0...-2fdc35d Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package cryprotobuf provides elements for working with Protocol Buffers format data.

Check out docs on https://developers.google.com/protocol-buffers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDataSource

func SetDataSource(prm interface {
	SetDataSource(neofscrypto.DataSource)
}, m StableProtoMarshaler, alloc BufferAllocator)

SetDataSource composes data source of neofscrypto.SignPrm from StableProtoMarshaler.

To read the data to be signed, a buffer is allocated using BufferAllocator. If alloc if not provided (nil), buffer is allocated via make.

StableProtoMarshaler is required and should not be nil.

Types

type BufferAllocator

type BufferAllocator func(int) []byte

BufferAllocator is a function which allocates byte slices of particular length.

type StableProtoMarshaler

type StableProtoMarshaler interface {
	// StableMarshal reads binary protobuf data into a buffer.
	//
	// Must return an error if the buffer size is not enough.
	StableMarshal([]byte) error

	// StableSize returns size of protobuf data.f
	//
	// Size must not be negative.
	StableSize() int
}

StableProtoMarshaler is the interface implemented by an object that can marshal itself into a stable protobuf binary form. Stable means the independence of the result from the number and place of calls.

Jump to

Keyboard shortcuts

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