Documentation ¶
Index ¶
Constants ¶
const ReadSize = lnwire.MaxMessagePayload + 16
ReadSize represents the size of the maximum message that can be read off the wire by brontide. The buffer is used to hold the ciphertext while the brontide state machine decrypts the message.
const WriteSize = lnwire.MaxMessagePayload
WriteSize represents the size of the maximum plaintext message than can be sent using brontide. The buffer does not include extra space for the MAC, as that is applied by the Noise protocol after encrypting the plaintext.
Variables ¶
This section is empty.
Functions ¶
func RecycleSlice ¶
func RecycleSlice(b []byte)
RecycleSlice zeroes byte slice, making it fresh for another use. Zeroing the buffer using a logarithmic number of calls to the optimized copy method. Benchmarking shows this to be ~30 times faster than a for loop that sets each index to 0 for ~65KB buffers use for wire messages. Inspired by: https://stackoverflow.com/questions/30614165/is-there-analog-of-memset-in-go