pub fn crypto_box_easy_inplace(
    data: &mut [u8],
    nonce: &Nonce,
    recipient_public_key: &PublicKey,
    sender_secret_key: &SecretKey
) -> Result<(), Error>
Expand description

Encrypts message with recipient’s public key recipient_public_key and sender’s secret key sender_secret_key using 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.

For this reason, the last CRYPTO_BOX_MACBYTES bytes from the input is ignored. The length of data should be the length of your message plus CRYPTO_BOX_MACBYTES bytes.