uniformdh

package
v0.0.0-...-8b1022e Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2016 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package uniformdh implements the Tor Project's UniformDH key exchange mechanism as defined in the obfs3 protocol specification. This implementation is suitable for obfuscation but MUST NOT BE USED when strong security is required as it is not constant time.

Index

Constants

View Source
const (
	// Size is the size of a UniformDH key or shared secret in bytes.
	Size = 1536 / 8
)

Variables

This section is empty.

Functions

func Handshake

func Handshake(privateKey *PrivateKey, publicKey *PublicKey) (sharedSecret []byte, err error)

Handshake generates a shared secret given a PrivateKey and PublicKey.

Types

type PrivateKey

type PrivateKey struct {
	PublicKey
	// contains filtered or unexported fields
}

A PrivateKey represents a UniformDH private key.

func GenerateKey

func GenerateKey(random io.Reader) (priv *PrivateKey, err error)

GenerateKey generates a UniformDH keypair using the random source random.

type PublicKey

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

A PublicKey represents a UniformDH public key.

func (*PublicKey) Bytes

func (pub *PublicKey) Bytes() (pubBytes []byte, err error)

Bytes returns the byte representation of a PublicKey.

func (*PublicKey) SetBytes

func (pub *PublicKey) SetBytes(pubBytes []byte) error

SetBytes sets the PublicKey from a byte slice.

Jump to

Keyboard shortcuts

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