[][src]Function rust_sodium::crypto::sealedbox::curve25519blake2bxsalsa20poly1305::open

pub fn open(
    c: &[u8],
    box_::PublicKey: &PublicKey,
    box_::SecretKey: &SecretKey
) -> Result<Vec<u8>, ()>

The open() function decrypts the ciphertext c using the key pair (pk, sk) and returns the decrypted message.

Key pairs are compatible with other crypto::box_::curve25519xsalsa20poly1305 operations and can be created using crypto::box::gen_keypair().

This function doesn't require passing the public key of the sender, as the ciphertext already includes this information.

If decryption fails it returns Err(()).