Documentation ¶
Index ¶
- Constants
- Variables
- func Decrypt(privKey libp2pc.PrivKey, ciphertext []byte) ([]byte, error)
- func DecryptAES(bytes []byte, key []byte) ([]byte, error)
- func Encrypt(pubKey libp2pc.PubKey, bytes []byte) ([]byte, error)
- func EncryptAES(bytes []byte, key []byte) ([]byte, error)
- func GenerateAESKey() ([]byte, error)
- func Verify(pk libp2pc.PubKey, data []byte, sig []byte) error
Constants ¶
View Source
const ( // Length of nacl nonce NonceBytes = 24 // Length of nacl ephemeral public key EphemeralPublicKeyBytes = 32 )
Variables ¶
View Source
var ( // Nacl box decryption failed BoxDecryptionError = fmt.Errorf("failed to decrypt curve25519") )
Functions ¶
func DecryptAES ¶
DecryptAES uses key (:32 key, 32:12 nonce) to perform AES-256 GCM decryption on bytes.
func EncryptAES ¶
EncryptAES performs AES-256 GCM encryption on the provided bytes with key
func GenerateAESKey ¶
GenerateAESKey returns 44 random bytes, 32 for the key and 12 for a nonce.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.