Skip to main content

crypto_box_open_detached

Function crypto_box_open_detached 

Source
pub fn crypto_box_open_detached(
    message: &mut [u8],
    ciphertext: &[u8],
    mac: &Mac,
    nonce: &Nonce,
    sender_public_key: &PublicKey,
    recipient_secret_key: &SecretKey,
) -> Result<(), Error>
Expand description

Detached variant of crypto_box_open_easy: decrypts ciphertext with the sender’s public key sender_public_key, the recipient’s secret key recipient_secret_key, nonce, and the detached mac.

Compatible with libsodium’s crypto_box_open_detached.

§Errors

Returns an error if ciphertext is too long, sender_public_key is unacceptable, message is shorter than ciphertext, or authentication fails.