nd

package
v0.0.0-...-8402838 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

Variables

This section is empty.

Functions

func Pick

func Pick(routers []*directory.ShortNodeInfo, needle *[32]byte) *directory.ShortNodeInfo

Types

type Conn

type Conn struct {
	Circuit *torch.Circuit
	Bit     bool
	KDF     io.Reader
	// contains filtered or unexported fields
}

func Handshake

func Handshake(ctx context.Context, c1, c2 *torch.Circuit, sharedSecret []byte) (*Conn, error)

func ND

func ND(ctx context.Context, needle *[32]byte, seed []byte) (*Conn, error)

func (*Conn) Close

func (ndc *Conn) Close() error

func (*Conn) FrameSize

func (ndc *Conn) FrameSize() int

func (*Conn) RecvFrame

func (ndc *Conn) RecvFrame(b []byte) error

Read writes 493 bytes and possibly returns an error.

func (*Conn) SendFrame

func (ndc *Conn) SendFrame(data []byte) error

Write takes a buf with len(buf) = FRAMESIZE and sends it over the connection. Encryption, authentication, and ordering preservation are applied using the seed given to ND().

type NetDog

type NetDog struct {
	// contains filtered or unexported fields
}

func Prepare

func Prepare(ctx context.Context) (*NetDog, error)

func (*NetDog) Close

func (nd *NetDog) Close() error

type Stream

type Stream struct {
	// contains filtered or unexported fields
}

func NDStream

func NDStream(ctx context.Context, needle *[32]byte, seed []byte) (*Stream, error)

func (*Stream) Close

func (nds *Stream) Close() error

func (*Stream) CloseWrite

func (nds *Stream) CloseWrite() error

func (*Stream) Read

func (nds *Stream) Read(out []byte) (int, error)

func (*Stream) Write

func (nds *Stream) Write(data []byte) (int, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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