client

package
v0.0.0-...-ebf7294 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: MIT-0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Meta .
	Meta struct {
		LocalLongTermEd25519PrivateKey     [64]byte
		LocalLongTermEd25519PublicKey      [32]byte
		RemoteLongTermEd25519PublicKey     [32]byte
		LocalEphemeralCurve25519PrivateKey [32]byte
		LocalEphemeralCurve25519PublicKey  [32]byte
		RemoteEphemeralCurve25519PublicKey [32]byte
		NetworkKey                         [32]byte
		Message1Sent                       []byte
		Message2Received                   []byte
		Message3Sent                       []byte
		Message4Received                   []byte
		Secretab                           [32]byte
		SecretaB                           [32]byte
		SecretAb                           [32]byte
		SecretabHash                       []byte
		SecretaBHash                       []byte
		SecretAbHash                       []byte
		SignatureA                         []byte
		SignatureB                         []byte
		FinalSharedSecret                  []byte
	}
)

Functions

func DeriveSharedABSecrets

func DeriveSharedABSecrets(
	clientEphemeralCurve25519PrivateKey,
	serverEphemeralCurve25519PublicKey,
	serverLongTermPublicIdentitytoCurve [32]byte) (s1, s2 [32]byte, h1, h2 []byte)

DeriveSharedABSecrets client calculates secrets ab and aB

func DeriveThirdSharedABSecret

func DeriveThirdSharedABSecret(
	clientLongTermSecretEd25519KeytoCurve,
	serverEphemeralCurve25519PublicKey [32]byte) ([32]byte, []byte)

DeriveThirdSharedABSecret client calculates final secret Ab

func Read2

func Read2(conn *websocket.Conn, networkKey [32]byte) (msg2, serverEphemeralPK []byte, success bool)

Read2 client receive (server hello): client receives connection in response to client-hello, client verifies server-hmac, receives msg2

func Read4

func Read4(
	conn *websocket.Conn,
	networkKey,
	secretab,
	secretaB,
	secretAb,
	clientLongTermPublicIdentity,
	serverLongTermPublicIdentity [32]byte,
	signatureA []byte) (msg4, finalKey []byte, success bool)

Read4 client receive (server accept): client receives response to client-authenticate, receives msg4 naclbox, unbox

func Shake

func Shake(
	conn *websocket.Conn,
	localPublicIdentity,
	remoteIdentity [32]byte,
	localPrivateKey [64]byte) bool

Shake client handshake

func SignatureA

func SignatureA(
	networkKey,
	serverLongTermPublicIdentity,
	sharedSecretHash [32]byte,
	clientEd25519PrivateKey [64]byte) []byte

SignatureA client signs target network key, and public id, and hash of shared secret

func Write1

func Write1(conn *websocket.Conn, clientEphemeralPublicKey, networkKey [32]byte) ([]byte, bool)

Write1 client sends (client hello): client initiates connection, msg1

func Write3

func Write3(
	conn *websocket.Conn,
	clientLongTermPublicIdentity,
	networkKey,
	secretab,
	secretaB [32]byte,
	signatureA []byte) ([]byte, bool)

Write3 client send (client authenticate): responds to server-hello with msg3 naclbox

Types

This section is empty.

Jump to

Keyboard shortcuts

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