Documentation ¶
Index ¶
- Constants
- func DecodeBase58RecoveryKey(recoveryKey string) []byte
- func DeriveKeysSHA256(key []byte, name string) ([AESCTRKeyLength]byte, [HMACKeyLength]byte)
- func EncodeBase58RecoveryKey(key []byte) string
- func GenA256CTRIV() (iv [AESCTRIVLength]byte)
- func GenAttachmentA256CTR() (key [AESCTRKeyLength]byte, iv [AESCTRIVLength]byte)
- func HMACSHA256B64(input []byte, hmacKey [HMACKeyLength]byte) string
- func PBKDF2SHA512(password []byte, salt []byte, iters int, keyLenBits int) []byte
- func XorA256CTR(source []byte, key [AESCTRKeyLength]byte, iv [AESCTRIVLength]byte) []byte
Constants ¶
const ( // AESCTRKeyLength is the length of the AES256-CTR key used. AESCTRKeyLength = 32 // AESCTRIVLength is the length of the AES256-CTR IV used. AESCTRIVLength = 16 // HMACKeyLength is the length of the HMAC key used. HMACKeyLength = 32 // SHAHashLength is the length of the SHA hash used. SHAHashLength = 32 )
Variables ¶
This section is empty.
Functions ¶
func DecodeBase58RecoveryKey ¶
DecodeBase58RecoveryKey recovers the secret storage from a recovery key.
func DeriveKeysSHA256 ¶
func DeriveKeysSHA256(key []byte, name string) ([AESCTRKeyLength]byte, [HMACKeyLength]byte)
DeriveKeysSHA256 derives an AES and a HMAC key from the given recovery key.
func EncodeBase58RecoveryKey ¶
EncodeBase58RecoveryKey recovers the secret storage from a recovery key.
func GenA256CTRIV ¶
func GenA256CTRIV() (iv [AESCTRIVLength]byte)
GenA256CTRIV generates a random IV for AES256-CTR with the last bit set to zero.
func GenAttachmentA256CTR ¶
func GenAttachmentA256CTR() (key [AESCTRKeyLength]byte, iv [AESCTRIVLength]byte)
GenAttachmentA256CTR generates a new random AES256-CTR key and IV suitable for encrypting attachments.
func HMACSHA256B64 ¶
func HMACSHA256B64(input []byte, hmacKey [HMACKeyLength]byte) string
HMACSHA256B64 calculates the base64 of the SHA256 hmac of the input with the given key.
func PBKDF2SHA512 ¶
PBKDF2SHA512 generates a key of the given bit-length using the given passphrase, salt and iteration count.
func XorA256CTR ¶
func XorA256CTR(source []byte, key [AESCTRKeyLength]byte, iv [AESCTRIVLength]byte) []byte
XorA256CTR encrypts the input with the keystream generated by the AES256-CTR algorithm with the given arguments.
Types ¶
This section is empty.