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 ¶
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.