Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CipherState ¶
type CipherState struct {
// contains filtered or unexported fields
}
CipherState is an alternate implementation of noise.CipherState that allows manual control over the nonce
func NewCipherState ¶
func NewCipherState(c noise.Cipher) *CipherState
NewCipherState initializes a new CipherState
func (*CipherState) CheckNonce ¶
func (s *CipherState) CheckNonce(n uint64) bool
CheckNonce returns true if the nonce is valid, and false if the nonce is reused or outside of the sliding window
func (*CipherState) Decrypt ¶
func (s *CipherState) Decrypt(out, ad, ciphertext []byte) ([]byte, error)
Decrypt is the same as noise.HandshakeState
func (*CipherState) Encrypt ¶
func (s *CipherState) Encrypt(out, ad, plaintext []byte) []byte
Encrypt is the same as noise.HandshakeState
func (*CipherState) Nonce ¶
func (s *CipherState) Nonce() uint64
Nonce returns the nonce value inside CipherState
func (*CipherState) SetNonce ¶
func (s *CipherState) SetNonce(n uint64)
SetNonce sets the nonce value inside CipherState
Click to show internal directories.
Click to hide internal directories.