primitives

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Perform3DH

func Perform3DH(longtermIdentity *Identity, ephemeralIdentity *Identity, remoteLongTermPublicKey ed25519.PublicKey, remoteEphemeralPublicKey ed25519.PublicKey, outbound bool) ([32]byte, error)

Perform3DH encapsulates a triple-diffie-hellman key exchange. In this exchange Alice and Bob both hold longterm identity keypairs Both Alice and Bob generate an additional ephemeral key pair: Three Diffie Hellman exchanges are then performed: Alice Long Term <-> Bob Ephemeral Alice Ephemeral <-> Bob Long Term Alice Ephemeral <-> Bob Ephemeral

Through this, a unique session key is derived. The exchange is offline-deniable (in the context of Tapir and Onion Service)

Types

type Identity

type Identity struct {
	Name string
	// contains filtered or unexported fields
}

Identity is an encapsulation of Name, PrivateKey and other features that make up a Tapir client. The purpose of Identity is to prevent other classes directly accessing private key and to ensure the integrity of security-critical functions.

func InitializeEphemeralIdentity

func InitializeEphemeralIdentity() (Identity, ed25519.PrivateKey)

InitializeEphemeralIdentity generates a new ephemeral identity, the private key of this identity is provided in the response.

func InitializeIdentity

func InitializeIdentity(name string, pk *ed25519.PrivateKey, pubk *ed25519.PublicKey) Identity

InitializeIdentity is a courtesy function for initializing a V3 Identity in-code.

func (*Identity) EDH

func (i *Identity) EDH(key ed25519.PublicKey) ([]byte, error)

EDH performs a diffie-hellman operation on this identities private key with the given public key.

func (*Identity) Hostname

func (i *Identity) Hostname() string

Hostname provides the onion address associated with this Identity.

func (*Identity) PublicKey

func (i *Identity) PublicKey() ed25519.PublicKey

PublicKey returns the public key associated with this Identity

func (*Identity) PublicKeyBytes

func (i *Identity) PublicKeyBytes() []byte

PublicKeyBytes returns the public key associated with this Identity in serializable-friendly format.

func (*Identity) Sign

func (i *Identity) Sign(input []byte) []byte

Sign produces a signature for a given message attributable to the given identity

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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