Documentation
¶
Index ¶
- func DecryptECDH(privateKey, nodePublicKey, encryptedData []byte) ([]byte, error)
- func DecryptECDHWithRPCURL(privateKey []byte, rpcUrl string, encryptedData []byte) ([]byte, error)
- func DecryptState(masterKey, contractAddress, value []byte) ([]byte, error)
- func DeriveEncryptionKey(masterKey, salt []byte) []byte
- func EncryptECDH(privateKey, nodePublicKey, data []byte) ([]byte, error)
- func EncryptECDHWithRPCURL(privateKey []byte, rpcUrl string, data []byte) ([]byte, error)
- func EncryptState(masterKey, contractAddress, value []byte) ([]byte, error)
- func FetchNodePublicKey(rpcUrl string) ([]byte, error)
- func GetCurve25519PublicKey(privateKey [32]byte) [32]byte
- type PublicKeyFetchResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptECDH ¶
func DecryptECDHWithRPCURL ¶
DecryptECDHWithRPCURL fetched node public key from rpcURL and decrypts provided value using provided encryption key
func DecryptState ¶
func DeriveEncryptionKey ¶
DeriveEncryptionKey derives encryption key using master key and salt
func EncryptECDH ¶
EncryptECDH encrypts provided value using encryption key, derived from user private key and node public key.
func EncryptECDHWithRPCURL ¶
EncryptECDHWithRPCURL fetched node public key from rpcURL and encrypts provided value using encryption key, derived from user private key
func EncryptState ¶
EncryptState encrypts smart contract state using simmetric key derived from master key only for specific contract. That allows us to improve cryptographic strength of our encryption scheme.
As an output, this function returns vector which contains 15 bytes nonce and ciphertext.