[][src]Function tox_crypto::encrypt_data_symmetric

pub fn encrypt_data_symmetric(
    precomputed_key: &PrecomputedKey,
    nonce: &Nonce,
    plain: &[u8]
) -> Vec<u8>

Returns encrypted data from plain, with length of plain + 16 due to padding.

Encryption is done using precomputed key (from the public key (32 bytes) of receiver and the secret key of sender) and a 24 byte nonce.

sodiumoxide takes care of padding the data, so the resulting encrypted data has length of plain + 16.

A wrapper for the seal_precomputed() function from sodiumoxide.