[][src]Function tox_crypto::encrypt_precompute

pub fn encrypt_precompute(
    their_public_key: &PublicKey,
    our_secret_key: &SecretKey
) -> PrecomputedKey

Precomputes the shared key from their_public_key and our_secret_key.

For fast encrypt/decrypt - this way we can avoid an expensive elliptic curve scalar multiply for each encrypt/decrypt operation.

Use if communication is not one-time.

encrypt_precompute does the shared-key generation once, so that it does not have to be performed on every encrypt/decrypt.

This a wrapper for the precompute() function from sodiumoxide crate.