Documentation ¶
Index ¶
- func CheckHMAC(message, messageMAC, key []byte) (bool, error)
- func CreateHMAC(message, key []byte) ([]byte, error)
- func CreateIK(userKey, iv []byte) ([]byte, error)
- func Decrypt(ciphertext, key []byte) ([]byte, error)
- func Encrypt(plaintext, key []byte) ([]byte, error)
- func GenerateIV() ([]byte, error)
- func GenerateRandomBytes(n int) ([]byte, error)
- func GenerateUserKey() ([]byte, error)
- func GenerateVMK() ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHMAC ¶
CreateHMAC takes a message and a key and returns HMAC of the message.
func CreateIK ¶
CreateIK generates 32 bytes Intermediate Key, given userKey and initialization vector. This would be used as key in AES-256 CBC encryption.
func Decrypt ¶
Decrypt returns a plaintext by decrypting a AES-256 CBC encrypted ciphertext using the given key .
func Encrypt ¶
Encrypt returns a cipher text by encrypting plaintext with the given key using AES-256 CBC encryption.
func GenerateIV ¶
GenerateIV generates 32 bytes Initialization Vector.
func GenerateRandomBytes ¶
GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateUserKey ¶
GenerateUserKey generates 32 bytes User Key.
func GenerateVMK ¶
GenerateVMK generates 64 bytes Volume Master Key.
Types ¶
This section is empty.