crypt

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Unlicense Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CryptMagic = "cryp"
)

Variables

This section is empty.

Functions

func NewCrypt

func NewCrypt(toHdr, toPld *crypto.Pub, from *crypto.Prv, iv nonce.IV,
	depth int) ont.Onion

Types

type Crypt

type Crypt struct {
	Depth                     int
	ToHeaderPub, ToPayloadPub *crypto.Pub
	From                      *crypto.Prv
	IV                        nonce.IV
	// The remainder here are for Decode.
	Cloak   crypto.CloakedPubKey
	ToPriv  *crypto.Prv
	FromPub *crypto.Pub
	ont.Onion
}

func (*Crypt) Account

func (x *Crypt) Account(res *sess.Data, sm *sess.Manager, s *sessions.Data,
	last bool) (skip bool, sd *sessions.Data)

func (*Crypt) Decode

func (x *Crypt) Decode(s *splice.Splice) (e error)

func (*Crypt) Decrypt

func (x *Crypt) Decrypt(prk *crypto.Prv, s *splice.Splice)

Decrypt requires the prv.Pub to be located from the Cloak, using the FromPub key to derive the shared secret, and then decrypts the rest of the message.

func (*Crypt) Encode

func (x *Crypt) Encode(s *splice.Splice) (e error)

func (*Crypt) GetOnion

func (x *Crypt) GetOnion() interface{}

func (*Crypt) Handle

func (x *Crypt) Handle(s *splice.Splice, p ont.Onion, ng ont.Ngin) (e error)

func (*Crypt) Len

func (x *Crypt) Len() int

func (*Crypt) Magic

func (x *Crypt) Magic() string

func (*Crypt) Wrap

func (x *Crypt) Wrap(inner ont.Onion)

Jump to

Keyboard shortcuts

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