Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PlainDecoder ¶
PlainDecoder reads data directly from the IO reader without modification. The entire buffer will be filled by reading data from the IO reader. This means that the buffer must be of the right length with respect to the data that is being read.
Types ¶
type Decoder ¶
A Decoder is a function the decodes bytes from an I/O reader into a byte slice. It returns the number of bytes read, and errors that happen.
func GCMDecoder ¶
func GCMDecoder(session *GCMSession, dec Decoder) Decoder
GCMDEcoder accepts a GCMSession and a decoder that wraps data decryption
func LengthPrefixDecoder ¶
LengthPrefixDecoder returns an Decoder that assumes all data is prefixed with a uint32 length. The returned Decoder wraps two other Decoders, one that is used to decode the length prefix, and one that is used to decode the actual data.
type Encoder ¶
An Encoder is a function that encodes a byte slice into an I/O writer. It returns the number of bytes written, and errors that happen.
func GCMEncoder ¶
func GCMEncoder(session *GCMSession, enc Encoder) Encoder
GCMEncoder accepts a GCMSession and an encoder that wraps data encryption
func LengthPrefixEncoder ¶
LengthPrefixEncoder returns an Encoder that prefixes all data with a uint32 length. The returned Encoder wraps two other Encoders, one that is used to encode the length prefix, and one that is used to encode the actual data.
type GCMSession ¶
type GCMSession struct {
// contains filtered or unexported fields
}
A GCMSession stores the state of a GCM authenticated/encrypted session. This includes the read/write nonces, memory buffers, and the GCM cipher itself.
func NewGCMSession ¶
func NewGCMSession(key [32]byte, self, remote id.Signatory) (*GCMSession, error)
NewGCMSession accepts a symmetric secret key and returns a new GCMSession that is configured using the symmetric secret key.