handshakes

package
v0.0.0-...-e847439 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PROTOID_NTOR  string = "ntor-curve25519-sha256-1"
	PROTOID_NTOR3 string = "ntor3-curve25519-sha3_256-1"
)
View Source
const HTYPE_NTOR uint16 = 0x0002
View Source
const HTYPE_NTOR3 uint16 = 0x0003

Variables

This section is empty.

Functions

This section is empty.

Types

type Client_NTor3Handshake

type Client_NTor3Handshake struct {
	NodeID ed25519.PublicKey

	KeyID     []byte // ntor-onion-key
	PublicKey ed25519.PublicKey
	Message   *message.Messages
	MAC       []byte

	TranslationTable message.TranslationTable
}

func (*Client_NTor3Handshake) Decode

func (ntor *Client_NTor3Handshake) Decode(r io.Reader) error

func (*Client_NTor3Handshake) Encode

func (ntor *Client_NTor3Handshake) Encode(w io.Writer) error

type Client_NTorHandshake

type Client_NTorHandshake struct {
	NodeID [20]byte

	KeyID      *ecdh.PublicKey  // ntor-onion-key
	PublicKey  *ecdh.PublicKey  // curve25519
	PrivateKey *ecdh.PrivateKey // curve25519
}

func (*Client_NTorHandshake) Decode

func (ntor *Client_NTorHandshake) Decode(r io.Reader) error

func (*Client_NTorHandshake) Derive

func (*Client_NTorHandshake) Encode

func (ntor *Client_NTorHandshake) Encode(w io.Writer) error

type Handshake

type Handshake interface {
	Decode(io.Reader) error
	Encode(io.Writer) error
}

func Client_HandshakeType

func Client_HandshakeType(htype uint16) Handshake

func Server_HandshakeType

func Server_HandshakeType(htype uint16) Handshake

type Server_NTor3Handshake

type Server_NTor3Handshake struct {
	PublicKey ed25519.PublicKey
	Auth      []byte
	Messages  *message.Messages

	TranslationTable message.TranslationTable
}

func (*Server_NTor3Handshake) Decode

func (ntor *Server_NTor3Handshake) Decode(r io.Reader) error

func (*Server_NTor3Handshake) Encode

func (ntor *Server_NTor3Handshake) Encode(io.Writer) error

type Server_NTorHandshake

type Server_NTorHandshake struct {
	PrivateKey *ecdh.PrivateKey // curve25519
	PublicKey  *ecdh.PublicKey  // curve25519
	Auth       []byte
}

func (*Server_NTorHandshake) Decode

func (ntor *Server_NTorHandshake) Decode(r io.Reader) error

func (*Server_NTorHandshake) Encode

func (ntor *Server_NTorHandshake) Encode(w io.Writer) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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