[][src]Function devolutions_crypto::ffi::MixKeyExchange

#[no_mangle]
pub unsafe extern "C" fn MixKeyExchange(
    private: *const u8,
    private_size: usize,
    public: *const u8,
    public_size: usize,
    shared: *mut u8,
    shared_size: 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 calling GenerateKeyExchangeSize() 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 calling GenerateKeyExchangeSize() beforehand.

Returns

Returns 0 if the generation worked. If there is an error, it will return the appropriate error code defined in DevoCryptoError.