Documentation
¶
Index ¶
- Constants
- func ComputeHMAC(key, message []byte) []byte
- func DecryptAES256CBC(key, ciphertext []byte) ([]byte, error)
- func DeriveKey(secret, salt, info []byte, length int) ([]byte, error)
- func DeriveSharedSecret(privateKey, peerPublicKey []byte) ([]byte, error)
- func EncryptAES256CBC(key, plaintext []byte) ([]byte, error)
- func GenerateAES256Key() ([]byte, error)
- func GenerateHMACKey(size int) ([]byte, error)
- func GenerateKeyPair() (privateKey, publicKey []byte, err error)
- func GenerateSigningKeyPair() (ed25519.PublicKey, ed25519.PrivateKey, error)
- func GetBasepoint() []byte
- func Hash(data []byte) []byte
- func Sign(privateKey ed25519.PrivateKey, message []byte) []byte
- func ValidateHMAC(key, message, messageHMAC []byte) bool
- func Verify(publicKey ed25519.PublicKey, message, signature []byte) bool
Constants ¶
View Source
const ( // AES256KeySize is the size of an AES-256 key in bytes. AES256KeySize = 32 // 256 bits )
View Source
const (
SHA256Size = 32
)
Variables ¶
This section is empty.
Functions ¶
func ComputeHMAC ¶
func DecryptAES256CBC ¶ added in v0.4.0
DecryptAES256CBC decrypts data using AES-256 in CBC mode. It assumes the IV is prepended to the ciphertext.
func DeriveSharedSecret ¶
func EncryptAES256CBC ¶ added in v0.4.0
EncryptAES256CBC encrypts data using AES-256 in CBC mode. The IV is prepended to the ciphertext.
func GenerateAES256Key ¶ added in v0.4.0
GenerateAES256Key generates a random AES-256 key.
func GenerateHMACKey ¶
func GenerateKeyPair ¶
func GenerateSigningKeyPair ¶
func GenerateSigningKeyPair() (ed25519.PublicKey, ed25519.PrivateKey, error)
func GetBasepoint ¶
func GetBasepoint() []byte
GetBasepoint returns the standard Curve25519 basepoint
func ValidateHMAC ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.