aead

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: 5 Imported by: 0

Documentation

Overview

Package aead provides a block cipher using aead.GCM with AES 256 encryption.

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 aead.GCM 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 15. The cipher used is cipher.AEAD created by cipher.NewGCM with an AES256 key derived from the private/publick key pairs using ECDH.

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