naclbox

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package naclbox provides a block cipher using nacl/{box,secretbox}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type T

type T struct {
	// contains filtered or unexported fields
}

T wraps go.crypto/nacl/{box,secretbox} to provide synchronized nonces between the requestor and responder assuming they interact in a strict request/response manner.

func NewCipher

func NewCipher(myPublicKey, myPrivateKey, theirPublicKey *[32]byte) (*T, error)

NewCipher returns a Cipher for RPC versions greater than or equal to 11. The underlying cipher is nacl/secretbox.

func (*T) ChannelBinding

func (c *T) ChannelBinding() []byte

func (*T) Open

func (c *T) Open(buf, data []byte) ([]byte, bool)

func (*T) Overhead

func (c *T) Overhead() int

func (*T) Seal

func (c *T) Seal(buf, data []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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