Documentation ¶
Index ¶
- Variables
- func CountedNonce(nonce []byte, counter uint64) []byte
- type AsymKey
- type Key
- func (key *Key) ChachaOpen(cipher []byte) ([]byte, error)
- func (key *Key) ChachaOpenFromReader(cipherReader io.Reader, plainWriter io.Writer) error
- func (key *Key) ChachaSeal(plain []byte) ([]byte, error)
- func (key *Key) ChachaSealFromReader(plainReader io.Reader, cipherWriter io.Writer) (int64, error)
- func (key *Key) Hex() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrWrongHolder = errors.New("wrong holder")
Functions ¶
func CountedNonce ¶
Types ¶
type AsymKey ¶
type AsymKey struct {
// contains filtered or unexported fields
}
func NewKeyPair ¶
func NewKeyPair() *AsymKey
func (*AsymKey) PrivateHex ¶
func (*AsymKey) VerboseHex ¶
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
func NewKeyFromBytes ¶
func NewKeyFromHex ¶
func (*Key) ChachaOpen ¶
ChachaOpen is a variant using `ChachaOpenFromReader` that takes a slice of bytes instead of an io.Reader
func (*Key) ChachaOpenFromReader ¶
func (*Key) ChachaSealFromReader ¶
ChachaSealFromReader reads plain text from an io.Reader and writes authenticated and encrypted data into an io.Writer. The sealing is done in chunks of `chunkSize` bytes. Every such chunk is preceded by 64bit big endian encoded size of the cipher text and a nonce used for that chunk. Following the final chunk a 64bit zero is written to denote the end of the cipher text.
Click to show internal directories.
Click to hide internal directories.