# README
brontide
The brontide package implements a secure crypto messaging protocol based off of the Noise Protocol Framework. The package exposes the raw state machine that handles the handshake and subsequent message encryption/decryption scheme. Additionally, the package exposes a net.Conn and a net.Listener interface implementation which allows the encrypted transport to be seamlessly integrated into a codebase.
The secure messaging scheme implemented within this package is described in detail in BOLT #8 of the Lightning Network specifications.
This package has intentionally been designed so it can be used as a standalone package for any projects needing secure encrypted+authenticated communications between network enabled programs.
Installation and Updating
$ go get -u github.com/lightningnetwork/lnd/brontide
# Functions
Dial attempts to establish an encrypted+authenticated connection with the remote peer located at address which has remotePub as its long-term static public key.
NewBrontideMachine creates a new instance of the brontide state-machine.
NewListener returns a new net.Listener which enforces the Brontide scheme during both initial connection establishment and data transfer.
# Constants
ActOneSize is the size of the packet sent from initiator to responder in ActOne.
ActThreeSize is the size of the packet sent from initiator to responder in ActThree.
ActTwoSize is the size the packet sent from responder to initiator in ActTwo.
HandshakeVersion is the expected version of the brontide handshake.
# Variables
ErrMaxMessageLengthExceeded is returned a message to be written to the cipher session exceeds the maximum allowed message payload.
# Structs
Conn is an implementation of net.Conn which enforces an authenticated key exchange and message encryption protocol dubbed "Brontide" after initial TCP connection establishment.
Listener is an implementation of a net.Conn which executes an authenticated key exchange and message encryption protocol dubeed "Machine" after initial connection acceptance.
Machine is a state-machine which implements Brontide: an Authenticated-key Exchange in Three Acts.