Documentation ¶
Index ¶
- Constants
- func DecryptBytes(key EncryptionKey, ciphertext []byte, iv []byte, padding int) (plaintext []byte, err error)
- func EncryptBytes(key EncryptionKey, plaintext []byte) (ciphertext []byte, iv []byte, padding int, err error)
- func GenerateSignatureKeys() (sk SecretKey, pk PublicKey, err error)
- func VerifyBytes(data []byte, pk PublicKey, sig Signature) bool
- type EncryptionKey
- type PublicKey
- type SecretKey
- type Signature
Constants ¶
View Source
const ( BlockSize = twofish.BlockSize KeySize = 32 )
Variables ¶
This section is empty.
Functions ¶
func DecryptBytes ¶
func DecryptBytes(key EncryptionKey, ciphertext []byte, iv []byte, padding int) (plaintext []byte, err error)
DecryptBytes decrypts a ciphertext using a key, an iv, and a volume of padding. `ciphertext` is not overwritten. The plaintext is returned.
func EncryptBytes ¶
func EncryptBytes(key EncryptionKey, plaintext []byte) (ciphertext []byte, iv []byte, padding int, err error)
EncryptBytes encrypts a []byte using a key. The padded ciphertext, iv, and amount of padding used are returned. `plaintext` is not overwritten.
func GenerateSignatureKeys ¶
GenerateKeyPair creates a public-secret keypair that can be used to sign and verify messages.
Types ¶
type EncryptionKey ¶
func GenerateEncryptionKey ¶
func GenerateEncryptionKey() (key EncryptionKey, err error)
GenerateEncryptionKey produces a key that can be used for encrypting and decrypting files.
type PublicKey ¶
type PublicKey *[ed25519.PublicKeySize]byte
type SecretKey ¶
type SecretKey *[ed25519.PrivateKeySize]byte
Click to show internal directories.
Click to hide internal directories.