Documentation
¶
Overview ¶
Package x3dh implements the X3DH key agreement protocol.
X3DH was originally written for the Signal instant messaging client. For more information see the specification:
Index ¶
- func ED25519PrivToCurve25519(sk ed25519.PrivateKey) (*ecdh.PrivateKey, error)
- func ED25519PubToCurve25519(key ed25519.PublicKey) (*ecdh.PublicKey, error)
- func NewInitMessage(idKey ed25519.PrivateKey, peerIDKey, opkPub ed25519.PublicKey, ...) ([]byte, []byte, *ecdh.PublicKey, error)
- func NewSignedPreKey(idKey ed25519.PrivateKey) (*ecdh.PrivateKey, []byte, error)
- func RecvInitMessage(idKey, opkPriv ed25519.PrivateKey, spkPriv *ecdh.PrivateKey, ...) ([]byte, []byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ED25519PrivToCurve25519 ¶
func ED25519PrivToCurve25519(sk ed25519.PrivateKey) (*ecdh.PrivateKey, error)
ED25519PrivToCurve25519 converts an ED25519 secret key to an ECDH key on the X25519 curve.
func ED25519PubToCurve25519 ¶
ED25519PubToCurve25519 converts an ED25519 public key to an ECDH key on the X25519 curve.
func NewInitMessage ¶
func NewInitMessage(idKey ed25519.PrivateKey, peerIDKey, opkPub ed25519.PublicKey, spkPub *ecdh.PublicKey, spkSig []byte) ([]byte, []byte, *ecdh.PublicKey, error)
NewInitMessage creates a new initiation message that can be used to start an X3DH session. Returned values are the session key, any associated data, and the ephemeral public key.
func NewSignedPreKey ¶
func NewSignedPreKey(idKey ed25519.PrivateKey) (*ecdh.PrivateKey, []byte, error)
NewSignedPreKey creates a new X25519 signed prekey (SPK) and signs the public part of the key with the identity key, returning the private key and the signature.
func RecvInitMessage ¶
func RecvInitMessage(idKey, opkPriv ed25519.PrivateKey, spkPriv *ecdh.PrivateKey, peerIDKey ed25519.PublicKey, ekPub *ecdh.PublicKey) ([]byte, []byte, error)
RecvInitMessage handles an incoming X3DH request. Returned values are the session key and any associated data.
Types ¶
This section is empty.