cryptobox

package
v0.0.0-...-da01528 Latest Latest
Warning

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

Go to latest
Published: May 25, 2015 License: ISC Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Box

func Box(cypherTextOut []byte, message []byte, nonce, pk, sk []byte) int

func BoxAfterNm

func BoxAfterNm(cypherTextOut []byte, message []byte, nonce, key []byte) int

func BoxBeforeNm

func BoxBeforeNm(keyOut []byte, pk, sk []byte) int

BoxBeforeNm is the first have of the box operation and generates a unique key per public, secret key pair (recipient, sender). The key is returned in KeyOut which can then be pssed to BoxAfterNm or BoxOpenAfterNm. The same key can be used for all messages between the same recipient/sender (same key pairs) provided that a unique nonce is used each time. This function is an optimization as it allows the shared key to be generated once for multiple messages.

Returns 0 on sucess, non-zero result on error.

func BoxBeforeNmBytes

func BoxBeforeNmBytes() int

BoxBeforeNmBytes specifies the size, in bytes, of the intermediate key that is generated from a given pair of public and secret keys.

func BoxBoxZeroBytes

func BoxBoxZeroBytes() int

func BoxDatched

func BoxDatched(cipherTextOut []byte, mac, message []byte, nonce, pk, sk []byte) int

func BoxDetachedAfterNm

func BoxDetachedAfterNm(cipherTextOut []byte, mac []byte, message []byte, nonce, key []byte) int

func BoxEasy

func BoxEasy(cypherTextOut []byte, message []byte, nonce, pk, sk []byte) int

func BoxEasyDetachedAfterNm

func BoxEasyDetachedAfterNm(cipherTextOut []byte, message []byte, nonce, key []byte) int

func BoxKeyPair

func BoxKeyPair(pkOut, skOut []byte) int

BoxKeyPair generates a new public/secret key pair, returning them in the passed buffers.

func BoxMacBytes

func BoxMacBytes() int

BoxMacBytes specifies the size, in bytes, of the MAC (Message Authentication Code) which is inserted into the cipher text to enable the message to be validated prior to decrypting it.

func BoxNonceBytes

func BoxNonceBytes() int

BoxNonceBytes specifies the size, in bytes, of the nonce used in the crypto_box functions.

func BoxOpen

func BoxOpen(messageOut []byte, cypherText []byte, nonce, pk, sk []byte) int

func BoxOpenAfterNm

func BoxOpenAfterNm(messageOut []byte, cypherText []byte, nonce, key []byte) int

func BoxOpenEasy

func BoxOpenEasy(messageOut []byte, cypherText []byte, nonce, pk, sk []byte) int

func BoxOpenEasyAfterNm

func BoxOpenEasyAfterNm(messageOut []byte, cypherText []byte, nonce, key []byte) int

func BoxPublicKeyBytes

func BoxPublicKeyBytes() int

BoxPublicKeyBytes returns the expected size, in bytes, of the public keys for the box functions.

func BoxSecretKeyBytes

func BoxSecretKeyBytes() int

BoxSecretKeyBytes returns the expected size, in bytes, of the secret keys for the box functions.

func BoxSeedBytes

func BoxSeedBytes() int

func BoxSeedKeyPair

func BoxSeedKeyPair(pkOut []byte, skOut []byte, seed []byte) int

func BoxZeroBytes

func BoxZeroBytes() int

BoxZeroBytes specifies the number of zero bytes of padding which must be present at the start of each message buffer for the box functions, except for the "Easy" version.

Types

This section is empty.

Jump to

Keyboard shortcuts

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