Documentation ¶
Index ¶
- func Box(cypherTextOut []byte, message []byte, nonce, pk, sk []byte) int
- func BoxAfterNm(cypherTextOut []byte, message []byte, nonce, key []byte) int
- func BoxBeforeNm(keyOut []byte, pk, sk []byte) int
- func BoxBeforeNmBytes() int
- func BoxBoxZeroBytes() int
- func BoxDatched(cipherTextOut []byte, mac, message []byte, nonce, pk, sk []byte) int
- func BoxDetachedAfterNm(cipherTextOut []byte, mac []byte, message []byte, nonce, key []byte) int
- func BoxEasy(cypherTextOut []byte, message []byte, nonce, pk, sk []byte) int
- func BoxEasyDetachedAfterNm(cipherTextOut []byte, message []byte, nonce, key []byte) int
- func BoxKeyPair(pkOut, skOut []byte) int
- func BoxMacBytes() int
- func BoxNonceBytes() int
- func BoxOpen(messageOut []byte, cypherText []byte, nonce, pk, sk []byte) int
- func BoxOpenAfterNm(messageOut []byte, cypherText []byte, nonce, key []byte) int
- func BoxOpenEasy(messageOut []byte, cypherText []byte, nonce, pk, sk []byte) int
- func BoxOpenEasyAfterNm(messageOut []byte, cypherText []byte, nonce, key []byte) int
- func BoxPublicKeyBytes() int
- func BoxSecretKeyBytes() int
- func BoxSeedBytes() int
- func BoxSeedKeyPair(pkOut []byte, skOut []byte, seed []byte) int
- func BoxZeroBytes() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoxBeforeNm ¶
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 BoxDetachedAfterNm ¶
func BoxEasyDetachedAfterNm ¶
func BoxKeyPair ¶
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 BoxOpenAfterNm ¶
func BoxOpenEasyAfterNm ¶
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 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.