Documentation
¶
Overview ¶
A library for managing encryption based on the wallet EC cryptography primitives
Index ¶
- Constants
- func DecryptSecret(masterKey memguard.LockedBuffer, cipherText []byte, iv Uint.U256, ...) (err error)
- func EncryptSecret(masterKey, plainText memguard.LockedBuffer, iv Uint.U256, cipherText []byte) (err error)
- type Encrypter
- type MasterKey
- func (mk *MasterKey) CleanKey()
- func (mk *MasterKey) Decrypt(cipherText []byte, plainText memguard.LockedBuffer) (err error)
- func (mk *MasterKey) Encrypt(plainText memguard.LockedBuffer, cipherText []byte) (err error)
- func (mk *MasterKey) SetKey(newKey memguard.LockedBuffer, newIV []byte) (err error)
- func (mk *MasterKey) SetKeyFromPassphrase(keyData memguard.LockedBuffer, salt []byte, rounds, method uint64) (err error)
Constants ¶
View Source
const ( // WalletKeySize is the size of keys (256 bits of course) WalletKeySize = 32 // WalletSaltSize is the size of a salt used to initialise the master key WalletSaltSize = 8 )
Variables ¶
This section is empty.
Functions ¶
func DecryptSecret ¶
func DecryptSecret(masterKey memguard.LockedBuffer, cipherText []byte, iv Uint.U256, plainText memguard.LockedBuffer) (err error)
func EncryptSecret ¶
Types ¶
type Encrypter ¶
type Encrypter struct { Key [WalletKeySize]byte IV [WalletSaltSize]byte KeyIsSet bool }
Encrypter is the controlling structure for managing en/decryption of wallet data
type MasterKey ¶
type MasterKey struct { EncryptedKey []byte Salt []byte DerivationMethod, DeriveIterations uint64 OtherDerivationParameters []byte }
Stores the data used to encrypt sensitive data in the wallet when it is set to encrypt
func (*MasterKey) CleanKey ¶
func (mk *MasterKey) CleanKey()
Clears the bytes where sensitive data was stored
func (*MasterKey) Decrypt ¶
func (mk *MasterKey) Decrypt(cipherText []byte, plainText memguard.LockedBuffer) (err error)
Decrypts a block of data
func (*MasterKey) Encrypt ¶
func (mk *MasterKey) Encrypt(plainText memguard.LockedBuffer, cipherText []byte) (err error)
Encrypt a block of data
func (*MasterKey) SetKey ¶
func (mk *MasterKey) SetKey(newKey memguard.LockedBuffer, newIV []byte) (err error)
Set the master key from a raw binary data and initialization vector
func (*MasterKey) SetKeyFromPassphrase ¶
func (mk *MasterKey) SetKeyFromPassphrase(keyData memguard.LockedBuffer, salt []byte, rounds, method uint64) (err error)
Sets the master key from a passphrase
Click to show internal directories.
Click to hide internal directories.