Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EncryptionParams ¶
type EncryptionParams interface { // Encrypt encrypts the given plain text and returns its cipher Encrypt(plain []byte) []byte // Decrypt decrypts the given cipher and returns its plain text Decrypt(cipher []byte) ([]byte, error) // Nonce (if given) sets the nonce and returns the current nonce Nonce(nonce []byte) []byte // Salt (if given) sets the salt and returns the current salt Salt(salt []byte) []byte }
EncryptionParams represents an interface to perform symmetric encryption
func NewEncryptionParams ¶
func NewEncryptionParams(key []byte) (EncryptionParams, error)
NewEncryptionParams returns a new EncryptionParams, using the given key to generate the salt and nonce parameters
func NewEncryptionParamsWithValues ¶
func NewEncryptionParamsWithValues(key, salt, nonce []byte) (EncryptionParams, error)
NewEncryptionParamsWithValues returns a new EncryptionParams using the given parameter values
Click to show internal directories.
Click to hide internal directories.