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 ¶
InitializeIdentity is a courtesy function for initializing a V3 Identity in-code.
func (*Identity) EDH ¶
EDH performs a diffie-hellman operation on this identities private key with the given public key.
func (*Identity) Hostname ¶
Hostname provides the onion address associated with this Identity.
func (*Identity) PublicKey ¶
PublicKey returns the public key associated with this Identity
func (*Identity) PublicKeyBytes ¶
PublicKeyBytes returns the public key associated with this Identity in serializable-friendly format.