Function gnunet_sys::GNUNET_IDENTITY_encrypt[][src]

pub unsafe extern "C" fn GNUNET_IDENTITY_encrypt(
    block: *const c_void,
    size: usize,
    pub_: *const GNUNET_IDENTITY_PublicKey,
    ecc: *mut GNUNET_CRYPTO_EcdhePublicKey,
    result: *mut c_void
) -> isize

Encrypt a block with #GNUNET_IDENTITY_PublicKey and derives a #GNUNET_CRYPTO_EcdhePublicKey which is required for decryption using ecdh to derive a symmetric key.

@param block the block to encrypt @param size the size of the @a block @param pub public key to use for ecdh @param ecc where to write the ecc public key @param result the output parameter in which to store the encrypted result can be the same or overlap with @c block @returns the size of the encrypted block, -1 for errors. Due to the use of CFB and therefore an effective stream cipher, this size should be the same as @c len.