fixbuf: Index | Files

package fixbuf

import ""


Package Files


func Read Uses

func Read(r io.Reader, c Constructor, objs ...interface{}) error

Read is the default implementation of Encoding interface Read

func Write Uses

func Write(w io.Writer, objs ...interface{}) error

Write is the default implementation of Encoding interface Write

type BinaryEncoding Uses

type BinaryEncoding struct {
    Constructor // Constructor for instantiating abstract types
    // contains filtered or unexported fields

BinaryEncoding represents a simple binary encoding suitable for reading and writing fixed-length cryptographic objects. The interface allows reading and writing composite types such as structs, arrays, and slices, but the encoded size of any object must be completely defined by the type and size of the object itself and the ciphersuite in use.

Slices must be instantiated to the correct length before either reading or writing: hence the reader must determine the correct length "out of band" (the encoding supports no transmission of length metadata).

func NewBinaryEncoding Uses

func NewBinaryEncoding(c Constructor) *BinaryEncoding

NewBinaryEncoding returns a BinaryEncoding. The given c Constructor can be nil. In that case, the BinaryEncoding MUST not be used to Read() any structure can contains any interface fields implementing the Marshalling interface, because BinaryEncoding won't be able to create the concrete type of the field.

func (BinaryEncoding) Read Uses

func (e BinaryEncoding) Read(r io.Reader, objs ...interface{}) error

Read a series of binary objects from an io.Reader. The objs must be a list of pointers.

func (BinaryEncoding) Write Uses

func (e BinaryEncoding) Write(w io.Writer, objs ...interface{}) error

Write a data structure containing cryptographic objects, using their built-in binary serialization, to an io.Writer. Supports writing of Points, Scalars, basic fixed-length data types supported by encoding/binary/Write(), and structs, arrays, and slices containing all of these types.

type Constructor Uses

type Constructor interface {
    New(t reflect.Type) interface{}

Constructor represents a generic constructor that takes a reflect.Type, typically for an interface type, and constructs some suitable concrete instance of that type. The crypto library uses this capability to support dynamic instantiation of cryptographic objects of the concrete type appropriate for a given abstract.Suite.

type Marshalling Uses

type Marshalling interface {
    // Encode the contents of this object and write it to an io.Writer.
    MarshalTo(w io.Writer) (int, error)

    // Decode the content of this object by reading from an io.Reader.
    UnmarshalFrom(r io.Reader) (int, error)

Marshaling is a basic interface representing fixed-length (or known-length) cryptographic objects or structures having a built-in binary encoding.

Package fixbuf imports 5 packages (graph) and is imported by 15 packages. Updated 2019-12-02. Refresh now. Tools for package owners.