Function dryoc::classic::crypto_box::crypto_box_open_easy_inplace
source · pub fn crypto_box_open_easy_inplace(
data: &mut [u8],
nonce: &Nonce,
sender_public_key: &PublicKey,
recipient_secret_key: &SecretKey
) -> Result<(), Error>
Expand description
Decrypts ciphertext
with recipient’s secret key recipient_secret_key
and
sender’s public key sender_public_key
with nonce
in-place in data
,
without allocated additional memory for the message.
The caller of this function is responsible for allocating data
such that
there’s enough capacity for the message plus the additional
CRYPTO_BOX_MACBYTES
bytes for the authentication tag.
After opening the box, the last CRYPTO_BOX_MACBYTES
bytes can be
discarded or ignored at the caller’s preference.