lnd/brontide
Olaoluwa Osuntokun 0c16ab6b32
brontide: reduce memory allocs by using static buf for next header+msg
In this commit, we reduce the total number of allocations that a
brontide session will incur over its lifetime. Profiling on one of my
nodes showed that we were generating a lot of garbage due to
re-creating a 65KB buffer to read the next message each time the
ReadMessage method was called.

To reduce the total number of memory allocations, we’ll now simply
re-use a buffer for both the cipher text header, and the cipher text
itself.
2018-02-24 19:30:45 -08:00
..
conn.go multi: comprehensive typo fixes across all packages 2018-02-06 19:11:11 -08:00
listener.go multi: Addressing Tor support review comments 2018-02-05 17:37:46 -08:00
noise_test.go multi: comprehensive typo fixes across all packages 2018-02-06 19:11:11 -08:00
noise.go brontide: reduce memory allocs by using static buf for next header+msg 2018-02-24 19:30:45 -08:00
README.md multi: fix formatting issues in packge README's 2017-03-27 16:25:25 -07:00

brontide

Build Status MIT licensed GoDoc

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