auth

package
v0.0.0-...-1d4be15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfig

func NewConfig(privkey, theirPubkey [32]byte) (config noise.Config, err error)

NewConfig initializes a new noise.Config with the provided data

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL