ntor

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: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	H_LENGTH                = 32
	ID_LENGTH               = 20
	G_LENGTH                = 32
	CLIENT_HANDSHAKE_LENGTH = ID_LENGTH + G_LENGTH + G_LENGTH
)

Variables

View Source
var (
	PROTOID  = []byte("ntor-curve25519-sha256-1")
	T_mac    = []byte(string(PROTOID) + ":mac")
	T_key    = []byte(string(PROTOID) + ":key_extract")
	T_verify = []byte(string(PROTOID) + ":verify")
	M_expand = []byte(string(PROTOID) + ":key_expand")
)

Functions

func ClientHandshake

func ClientHandshake(ID, B []byte) (client_handshake []byte, X_, x_ *[G_LENGTH]byte)

func ClientVerifyHandshake

func ClientVerifyHandshake(ID, B_ []byte, X, x *[G_LENGTH]byte, serverHandshake []byte) (io.Reader, error)

func H

func H(message, tweak []byte) []byte

func ServerHandshake

func ServerHandshake(b *[G_LENGTH]byte, client_handshake []byte) (serverHandshake []byte, kdf io.Reader)

ServerHandshake computes a response to a client handshake with with public DH value X using the ntor-onion-key B and the corresponding secret key b.

Types

This section is empty.

Jump to

Keyboard shortcuts

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