types

package
v0.0.0-...-1267fb5 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Type_Getpubkey uint32 = iota
	Type_Pubkey
	Type_Msg
	Type_Broadcast
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Behavior

type Behavior uint32
const (
	Behavior_DoesAck Behavior = 1 << iota
	Behavior_IncludeDestination
	Behavior_ExtendedEncoding
)

type Broadcast

type Broadcast struct {
	Version   uint64
	Stream    uint64
	Behavior  Behavior
	Combo     crypt.PublicCombo
	Trials    uint64
	Extra     uint64
	Encoding  Encoding
	Contents  []byte
	Signature []byte
}

func (*Broadcast) Marshal

func (b *Broadcast) Marshal() []byte

func (*Broadcast) Sign

func (b *Broadcast) Sign(header, sigkey []byte)

func (*Broadcast) Unmarshal

func (b *Broadcast) Unmarshal(data []byte)

func (*Broadcast) Verify

func (b *Broadcast) Verify(header []byte) bool

func (*Broadcast) VerifyWithAlgorithm

func (b *Broadcast) VerifyWithAlgorithm(header []byte) (string, error)

type Encoding

type Encoding uint64
const (
	Encoding_Ignore Encoding = iota
	Encoding_Trivial
	Encoding_Simple
	Encoding_Extended
)

type Getpubkey

type Getpubkey struct {
	Ripe []byte
	Tag  []byte
}

func UnmarshalGetpubkey

func UnmarshalGetpubkey(data []byte) (*Getpubkey, error)
type Header struct {
	Nonce   uint64
	Expires uint64
	Type    uint32
	Version uint64
	Stream  uint64
}

func (*Header) Marshal

func (h *Header) Marshal() []byte

type Message

type Message struct {
	Version   uint64
	Stream    uint64
	Behavior  Behavior
	Combo     crypt.PublicCombo
	Trials    uint64
	Extra     uint64
	Ripe      crypt.Ripe
	Encoding  Encoding
	Contents  []byte
	Ack       []byte
	Signature []byte
}

func (*Message) Marshal

func (m *Message) Marshal() []byte

func (*Message) SigHash

func (m *Message) SigHash() []byte

func (*Message) Sign

func (m *Message) Sign(header, sigkey []byte)

func (*Message) Unmarshal

func (m *Message) Unmarshal(data []byte)

func (*Message) Verify

func (m *Message) Verify(header []byte) bool

func (*Message) VerifyWithAlgorithm

func (m *Message) VerifyWithAlgorithm(header []byte) (string, error)

type Object

type Object struct {
	Header  Header
	Payload []byte
}

func UnmarshalObject

func UnmarshalObject(data []byte) (*Object, error)

func (*Object) Marshal

func (o *Object) Marshal() []byte

type Pubkey2

type Pubkey2 struct {
	Behavior      uint32
	SigningKey    []byte
	EncryptionKey []byte
}

func UnmarshalPubkey2

func UnmarshalPubkey2(data []byte) (*Pubkey2, error)

type Pubkey34

type Pubkey34 struct {
	Pubkey2
	Trials    uint64
	Extra     uint64
	Signature []byte
}

type Simple

type Simple struct {
	Subject      string
	IsReply      bool
	Body         string
	Comment      string
	ParentHashes [][]byte
}

func (*Simple) Unmarshal

func (s *Simple) Unmarshal(contents []byte)

type Tagged

type Tagged struct {
	Tag       [32]byte
	Encrypted []byte
}

Jump to

Keyboard shortcuts

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