sodium

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2013 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const PUBLICKEYBYTES int = 32
View Source
const SECRETKEYBYTES int = 32

Variables

This section is empty.

Functions

func CryptoBox

func CryptoBox(nonce []byte, plaintext string)

func CryptoBoxKeypair

func CryptoBoxKeypair() (pk [SECRETKEYBYTES]byte, sk [PUBLICKEYBYTES]byte)

func CryptoOpen

func CryptoOpen(nonce []byte, ciphertext string)

func IncrementalNonceStrategy

func IncrementalNonceStrategy() func() []byte

func RandomNonceStrategy

func RandomNonceStrategy() func() []byte

func Randombytes

func Randombytes(bytes []byte)

Types

type Session

type Session struct {
	// the public key of the agent who is sending you encrypted messages
	Public [PUBLICKEYBYTES]byte

	// your secret key
	Secret [SECRETKEYBYTES]byte

	// The nonce generator.
	Nonce func() []byte
	// contains filtered or unexported fields
}

func NewSession

func NewSession(pk [PUBLICKEYBYTES]byte, sk [SECRETKEYBYTES]byte) (s *Session)

func (*Session) Box

func (s *Session) Box(plaintext []byte) (ciphertext []byte, nonce []byte)

func (*Session) Open

func (s *Session) Open(nonce []byte, ciphertext []byte) []byte

func (*Session) Precompute

func (s *Session) Precompute()

Jump to

Keyboard shortcuts

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