Documentation
¶
Index ¶
- Constants
- type Conn
- type NoiseState
- func (ns *NoiseState) ConsumeHandshakeP1(in []byte) error
- func (ns *NoiseState) ConsumeHandshakeP2(in []byte) error
- func (ns *NoiseState) Decrypt(ciphertext, decrypted []byte, n uint64) ([]byte, error)
- func (ns *NoiseState) Encrypt(plaintext, encrypted []byte, n uint64) ([]byte, error)
- func (ns *NoiseState) GenerateHandshakeP1(out []byte) ([]byte, error)
- func (ns *NoiseState) GenerateHandshakeP2(out []byte) ([]byte, error)
- func (ns *NoiseState) Initialize(initiator bool) error
- func (ns *NoiseState) Nonce() uint64
- func (ns *NoiseState) Reset()
Constants ¶
View Source
const ( None uint64 = iota HandshakeSent HandshakeReceived HandshakeComplete )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) Close ¶
Close closes the noise connection, resetting the state, and requiring a new conn to be set and a new Dial or Accept call to establish a new connection.
type NoiseState ¶
type NoiseState struct {
// contains filtered or unexported fields
}
func NewNoiseState ¶
func NewNoiseState(s noise.DHKey, rs []byte) *NoiseState
func (*NoiseState) ConsumeHandshakeP1 ¶
func (ns *NoiseState) ConsumeHandshakeP1(in []byte) error
Consume handshake message p1 as responder
func (*NoiseState) ConsumeHandshakeP2 ¶
func (ns *NoiseState) ConsumeHandshakeP2(in []byte) error
Consume handshake message p2 as initiator
func (*NoiseState) Decrypt ¶
func (ns *NoiseState) Decrypt(ciphertext, decrypted []byte, n uint64) ([]byte, error)
func (*NoiseState) Encrypt ¶
func (ns *NoiseState) Encrypt(plaintext, encrypted []byte, n uint64) ([]byte, error)
func (*NoiseState) GenerateHandshakeP1 ¶
func (ns *NoiseState) GenerateHandshakeP1(out []byte) ([]byte, error)
Construct handshake message p1 as initiator
func (*NoiseState) GenerateHandshakeP2 ¶
func (ns *NoiseState) GenerateHandshakeP2(out []byte) ([]byte, error)
Construct handshake message p2 as responder
func (*NoiseState) Initialize ¶
func (ns *NoiseState) Initialize(initiator bool) error
func (*NoiseState) Nonce ¶
func (ns *NoiseState) Nonce() uint64
func (*NoiseState) Reset ¶
func (ns *NoiseState) Reset()
Click to show internal directories.
Click to hide internal directories.