[−][src]Function devolutions_crypto::ffi::GenerateKeyExchange
#[no_mangle] pub unsafe extern "C" fn GenerateKeyExchange(
private: *mut u8,
private_length: usize,
public: *mut u8,
public_length: usize
) -> i64
Generate a key pair to perform a key exchange. Must be used with MixKey()
Arguments
private
- Pointer to the buffer to write the private key to.private_length
- Length of the buffer to write the private key to. You can get the value by callingGenerateKeyExchangeSize()
beforehand.public
- Pointer to the buffer to write the public key to.public_length
- Length of the buffer to write the public key to. You can get the value by callingGenerateKeyExchangeSize()
beforehand.
Returns
Returns 0 if the generation worked. If there is an error, it will return the appropriate error code defined in DevoCryptoError.