Function chain_crypto::asymlock::encrypt

source ·
pub fn encrypt<R: RngCore + CryptoRng>(
    rng: &mut R,
    app_info: &[u8],
    receiver_pk: &GroupElement,
    data: &[u8]
) -> Vec<u8>
Expand description

Encrypt data in an assymetric lock

Return

the data encrypted with a ephemeral public key in prefix and the poly1305 tag in suffix.