Documentation ¶
Index ¶
- func CreateValueKey(pid peer.ID, ctxID []byte) []byte
- func DecryptAES(nonce, payload, passphrase []byte) ([]byte, error)
- func DecryptMetadata(encMetadata, valueKey []byte) ([]byte, error)
- func DecryptValueKey(valKey, mh multihash.Multihash) ([]byte, error)
- func EncryptAES(payload, passphrase []byte) ([]byte, []byte, error)
- func EncryptMetadata(metadata, valueKey []byte) ([]byte, error)
- func EncryptValueKey(valKey, mh multihash.Multihash) ([]byte, error)
- func SHA256(payload, dest []byte) []byte
- func SecondMultihash(mh multihash.Multihash) multihash.Multihash
- func SplitValueKey(valKey []byte) (peer.ID, []byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateValueKey ¶
CreateValueKey creates value key from peer ID and context ID
func DecryptAES ¶
DecryptAES decrypts AES payload using the nonce and the passphrase
func DecryptMetadata ¶
DecryptMetadata decrypts metdata using the provided passphrase
func DecryptValueKey ¶
DecryptValueKey decrypts the value key using the passphrase
func EncryptAES ¶
encryptAES uses AESGCM to encrypt the payload with the passphrase and a nonce derived from it. returns nonce and encrypted bytes.
func EncryptMetadata ¶
EncryptMetadata encrypts metadata using the provided passphrase
func EncryptValueKey ¶
EncryptValueKey encrypts raw value key using the passpharse
func SecondMultihash ¶
func SecondMultihash(mh multihash.Multihash) multihash.Multihash
SecondMultihash calculates SHA256 over the multihash and wraps it into another multihash with DBL_SHA256 codec.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.