box

package
v0.0.0-...-dd1b7db Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2014 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CVLen = 48

Variables

View Source
var ErrAuthFailed = errors.New("box: message authentication failed")
View Source
var Noise255 = noise255{}

Functions

func DeriveKey

func DeriveKey(secret, extra, info []byte, outputLen int) []byte

Types

type CipherContext

type CipherContext interface {
	Reset(cc []byte)
	Encrypt(dst, plaintext, authtext []byte) []byte
	Decrypt(ciphertext, authtext []byte) ([]byte, error)
}

type Ciphersuite

type Ciphersuite interface {
	AppendName(dst []byte) []byte
	DHLen() int
	CCLen() int
	MACLen() int
	KeyLen() (int, int)
	GenerateKey(io.Reader) (Key, error)

	DH(privkey, pubkey []byte) []byte
	NewCipher(cc []byte) CipherContext
}

type Crypter

type Crypter struct {
	Cipher   Ciphersuite
	Key      Key
	PeerKey  Key
	ChainVar []byte
	// contains filtered or unexported fields
}

func (*Crypter) BodyLen

func (c *Crypter) BodyLen(n int) int

func (*Crypter) BoxLen

func (c *Crypter) BoxLen(n int) int

func (*Crypter) DecryptBody

func (c *Crypter) DecryptBody(ciphertext, authtext []byte) ([]byte, error)

func (*Crypter) DecryptBox

func (c *Crypter) DecryptBox(ciphertext []byte, kdfNum uint8) ([]byte, error)

func (*Crypter) EncryptBody

func (c *Crypter) EncryptBody(dst, plaintext, authtext []byte, padLen int) []byte

func (*Crypter) EncryptBox

func (c *Crypter) EncryptBox(dst []byte, ephKey *Key, plaintext []byte, padLen int, kdfNum uint8) ([]byte, error)

func (*Crypter) SetContext

func (c *Crypter) SetContext(cc []byte)

type Key

type Key struct {
	Public  []byte
	Private []byte
}

Jump to

Keyboard shortcuts

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