Function hdk::prelude::x_25519_x_salsa20_poly1305_decrypt
source · pub fn x_25519_x_salsa20_poly1305_decrypt(
recipient: X25519PubKey,
sender: X25519PubKey,
encrypted_data: XSalsa20Poly1305EncryptedData
) -> Result<Option<XSalsa20Poly1305Data>, WasmError>
Expand description
Libsodium keypair based authenticated encryption: box_open
Opens encrypted data created by box.
If the encrypted data fails authentication and cannot be decrypted this function returns None
.
This means that if any decrypted data is returned by this function it was created by either keypair and has not been tampered with.