diff --git a/Cargo.lock b/Cargo.lock index 71da5935d..f23850974 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -519,6 +519,7 @@ dependencies = [ "subtle", "thiserror", "typed-builder", + "uniffi", "wasm-bindgen", "wasm-bindgen-test", "x25519-dalek", @@ -567,8 +568,8 @@ name = "devolutions-crypto-uniffi" version = "0.9.3" dependencies = [ "devolutions-crypto", + "rust-argon2", "uniffi", - "uniffi-builder-macro", ] [[package]] @@ -756,6 +757,8 @@ checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" dependencies = [ "equivalent", "hashbrown 0.16.0", + "serde", + "serde_core", ] [[package]] @@ -1299,6 +1302,15 @@ dependencies = [ "serde_core", ] +[[package]] +name = "serde_spanned" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776" +dependencies = [ + "serde_core", +] + [[package]] name = "sha2" version = "0.10.9" @@ -1458,11 +1470,17 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.11" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8" dependencies = [ - "serde", + "indexmap", + "serde_core", + "serde_spanned", + "toml_datetime", + "toml_parser", + "toml_writer", + "winnow", ] [[package]] @@ -1495,6 +1513,12 @@ dependencies = [ "winnow", ] +[[package]] +name = "toml_writer" +version = "1.0.6+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" + [[package]] name = "typed-builder" version = "0.23.2" @@ -1529,16 +1553,15 @@ checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" [[package]] name = "uniffi" -version = "0.29.5" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3291800a6b06569f7d3e15bdb6dc235e0f0c8bd3eb07177f430057feb076415f" +checksum = "c866f627c3f04c3df068b68bb2d725492caaa539dd313e2a9d26bb85b1a32f4e" dependencies = [ "anyhow", "camino", "cargo_metadata", "clap", "uniffi_bindgen", - "uniffi_build", "uniffi_core", "uniffi_macros", "uniffi_pipeline", @@ -1561,9 +1584,9 @@ dependencies = [ [[package]] name = "uniffi_bindgen" -version = "0.29.5" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a04b99fa7796eaaa7b87976a0dbdd1178dc1ee702ea00aca2642003aef9b669e" +checksum = "7c8ca600167641ebe7c8ba9254af40492dda3397c528cc3b2f511bd23e8541a5" dependencies = [ "anyhow", "askama", @@ -1585,22 +1608,11 @@ dependencies = [ "uniffi_udl", ] -[[package]] -name = "uniffi_build" -version = "0.29.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "025a05cba02ee22b6624ac3d257e59c7395319ea8fe1aae33a7cdb4e2a3016cc" -dependencies = [ - "anyhow", - "camino", - "uniffi_bindgen", -] - [[package]] name = "uniffi_core" -version = "0.29.5" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38a9a27529ccff732f8efddb831b65b1e07f7dea3fd4cacd4a35a8c4b253b98" +checksum = "7e7a5a038ebffe8f4cf91416b154ef3c2468b18e828b7009e01b1b99938089f9" dependencies = [ "anyhow", "bytes", @@ -1610,9 +1622,9 @@ dependencies = [ [[package]] name = "uniffi_internal_macros" -version = "0.29.5" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09acd2ce09c777dd65ee97c251d33c8a972afc04873f1e3b21eb3492ade16933" +checksum = "e3c2a6f93e7b73726e2015696ece25ca0ac5a5f1cf8d6a7ab5214dd0a01d2edf" dependencies = [ "anyhow", "indexmap", @@ -1623,9 +1635,9 @@ dependencies = [ [[package]] name = "uniffi_macros" -version = "0.29.5" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5596f178c4f7aafa1a501c4e0b96236a96bc2ef92bdb453d83e609dad0040152" +checksum = "64c6309fc36c7992afc03bc0c5b059c656bccbef3f2a4bc362980017f8936141" dependencies = [ "camino", "fs-err", @@ -1640,9 +1652,9 @@ dependencies = [ [[package]] name = "uniffi_meta" -version = "0.29.5" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beadc1f460eb2e209263c49c4f5b19e9a02e00a3b2b393f78ad10d766346ecff" +checksum = "0a138823392dba19b0aa494872689f97d0ee157de5852e2bec157ce6de9cdc22" dependencies = [ "anyhow", "siphasher", @@ -1652,9 +1664,9 @@ dependencies = [ [[package]] name = "uniffi_pipeline" -version = "0.29.5" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd76b3ac8a2d964ca9fce7df21c755afb4c77b054a85ad7a029ad179cc5abb8a" +checksum = "8c27c4b515d25f8e53cc918e238c39a79c3144a40eaf2e51c4a7958973422c29" dependencies = [ "anyhow", "heck", @@ -1665,9 +1677,9 @@ dependencies = [ [[package]] name = "uniffi_udl" -version = "0.29.5" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319cf905911d70d5b97ce0f46f101619a22e9a189c8c46d797a9955e9233716" +checksum = "d0adacdd848aeed7af4f5af7d2f621d5e82531325d405e29463482becfdeafca" dependencies = [ "anyhow", "textwrap", diff --git a/Cargo.toml b/Cargo.toml index 909bb8a8b..b7dfb8299 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,8 @@ members = [ ] [workspace.dependencies] -uniffi = "0.29.1" +uniffi = "0.30.0" +rust-argon2 = { version = "3.0", default-features = false } [package] name = "devolutions-crypto" @@ -50,7 +51,8 @@ rand = "0.9" rand_08 = { package = "rand", version = "0.8" } thiserror = "2.0.12" typed-builder = "0.23.2" -rust-argon2 = { version = "3.0", default-features = false } +rust-argon2 = { workspace = true } +uniffi = { workspace = true, optional = true } ed25519-dalek = { version = "2", features = [ "rand_core" ] } x25519-dalek = { version = "2", features = [ "static_secrets" ] } @@ -76,6 +78,7 @@ wasm-bindgen-test = "0.3" default = [] fuzz = ["arbitrary", "blahaj/fuzzing"] wbindgen = ["wasm-bindgen", "serde-wasm-bindgen", "js-sys"] +uniffi-support = ["uniffi"] [dependencies.getrandom_v02] package = "getrandom" diff --git a/src/enums.rs b/src/enums.rs index fd4ceb08d..703dee101 100644 --- a/src/enums.rs +++ b/src/enums.rs @@ -10,6 +10,7 @@ use wasm_bindgen::prelude::*; /// The different data types. #[cfg_attr(feature = "wbindgen", wasm_bindgen())] #[cfg_attr(feature = "fuzz", derive(Arbitrary))] +#[cfg_attr(feature = "uniffi-support", derive(uniffi::Enum))] #[derive(Clone, Copy, PartialEq, Eq, Zeroize, IntoPrimitive, TryFromPrimitive, Debug)] #[repr(u16)] #[derive(Default)] @@ -36,6 +37,7 @@ pub enum DataType { /// The versions of the encryption scheme to use. #[cfg_attr(feature = "wbindgen", wasm_bindgen())] #[cfg_attr(feature = "fuzz", derive(Arbitrary))] +#[cfg_attr(feature = "uniffi-support", derive(uniffi::Enum))] #[derive(Clone, Copy, PartialEq, Eq, Zeroize, IntoPrimitive, TryFromPrimitive, Debug)] #[repr(u16)] #[derive(Default)] @@ -66,6 +68,7 @@ pub enum OnlineCiphertextVersion { /// The versions of the password hashing scheme to use. #[cfg_attr(feature = "wbindgen", wasm_bindgen())] #[cfg_attr(feature = "fuzz", derive(Arbitrary))] +#[cfg_attr(feature = "uniffi-support", derive(uniffi::Enum))] #[derive(Clone, Copy, PartialEq, Eq, Zeroize, IntoPrimitive, TryFromPrimitive, Debug)] #[repr(u16)] #[derive(Default)] @@ -80,6 +83,7 @@ pub enum PasswordHashVersion { /// The versions of the key scheme to use. #[cfg_attr(feature = "wbindgen", wasm_bindgen())] #[cfg_attr(feature = "fuzz", derive(Arbitrary))] +#[cfg_attr(feature = "uniffi-support", derive(uniffi::Enum))] #[derive(Clone, Copy, PartialEq, Eq, Zeroize, IntoPrimitive, TryFromPrimitive, Debug)] #[repr(u16)] #[derive(Default)] @@ -93,6 +97,7 @@ pub enum KeyVersion { #[cfg_attr(feature = "wbindgen", wasm_bindgen())] #[cfg_attr(feature = "fuzz", derive(Arbitrary))] +#[cfg_attr(feature = "uniffi-support", derive(uniffi::Enum))] #[derive(Clone, Copy, PartialEq, Eq, Zeroize, IntoPrimitive, TryFromPrimitive, Debug)] #[repr(u16)] #[derive(Default)] @@ -107,6 +112,7 @@ pub enum SigningKeyVersion { /// The versions of the secret sharing scheme to use. #[cfg_attr(feature = "wbindgen", wasm_bindgen())] #[cfg_attr(feature = "fuzz", derive(Arbitrary))] +#[cfg_attr(feature = "uniffi-support", derive(uniffi::Enum))] #[derive(Clone, Copy, PartialEq, Eq, Zeroize, IntoPrimitive, TryFromPrimitive, Debug)] #[repr(u16)] #[derive(Default)] @@ -121,6 +127,7 @@ pub enum SecretSharingVersion { /// The versions of the secret sharing scheme to use. #[cfg_attr(feature = "wbindgen", wasm_bindgen())] #[cfg_attr(feature = "fuzz", derive(Arbitrary))] +#[cfg_attr(feature = "uniffi-support", derive(uniffi::Enum))] #[derive(Clone, Copy, PartialEq, Eq, Zeroize, IntoPrimitive, TryFromPrimitive, Debug)] #[repr(u16)] #[derive(Default)] diff --git a/src/error.rs b/src/error.rs index 99a8d5ee4..cb919a1d1 100644 --- a/src/error.rs +++ b/src/error.rs @@ -22,6 +22,8 @@ pub type Result = std::result::Result; // } /// This crate's error type. +#[cfg_attr(feature = "uniffi-support", derive(uniffi::Error))] +#[cfg_attr(feature = "uniffi-support", uniffi(flat_error))] #[derive(Debug, IntoStaticStr, thiserror::Error)] pub enum Error { /// The provided data has an invalid length. Error code: -1 diff --git a/src/lib.rs b/src/lib.rs index 51e572af8..e90647ce2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -240,3 +240,6 @@ pub const DEFAULT_PBKDF2_ITERATIONS: u32 = 10000; #[cfg(feature = "wbindgen")] pub mod wasm; + +#[cfg(feature = "uniffi-support")] +uniffi::setup_scaffolding!(); diff --git a/uniffi/devolutions-crypto-uniffi/Cargo.toml b/uniffi/devolutions-crypto-uniffi/Cargo.toml index ab404c42e..265372395 100644 --- a/uniffi/devolutions-crypto-uniffi/Cargo.toml +++ b/uniffi/devolutions-crypto-uniffi/Cargo.toml @@ -7,9 +7,6 @@ version.workspace = true crate-type = ["cdylib", "staticlib"] [dependencies] -devolutions-crypto = { path = "../../" } -uniffi-builder-macro = { path = "./uniffi-builder-macro" } +devolutions-crypto = { path = "../../", features = ["uniffi-support"] } uniffi = { workspace = true } - -[build-dependencies] -uniffi = { workspace = true, features = ["build"] } +rust-argon2 = { workspace = true } diff --git a/uniffi/devolutions-crypto-uniffi/build.rs b/uniffi/devolutions-crypto-uniffi/build.rs deleted file mode 100644 index 3f64bede2..000000000 --- a/uniffi/devolutions-crypto-uniffi/build.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - uniffi::generate_scaffolding("src/devolutions_crypto.udl").unwrap(); -} diff --git a/uniffi/devolutions-crypto-uniffi/src/argon2parameters.rs b/uniffi/devolutions-crypto-uniffi/src/argon2parameters.rs index bb47d9e52..5b4c948df 100644 --- a/uniffi/devolutions-crypto-uniffi/src/argon2parameters.rs +++ b/uniffi/devolutions-crypto-uniffi/src/argon2parameters.rs @@ -1,42 +1,142 @@ -use crate::Result; +use crate::{Argon2Variant, Argon2Version, Result}; +use std::sync::{Arc, Mutex}; -use devolutions_crypto::{Argon2Variant, Argon2Version}; +#[derive(uniffi::Object)] +pub struct Argon2ParametersBuilder { + length: Mutex>, + lanes: Mutex>, + memory: Mutex>, + iterations: Mutex>, + variant: Mutex>, + version: Mutex>, + dc_version: Mutex>, + associated_data: Mutex>>, + secret_key: Mutex>>, + salt: Mutex>>, +} -use uniffi_builder_macro::UniffiBuilder; +#[uniffi::export] +impl Argon2ParametersBuilder { + #[uniffi::constructor] + pub fn new() -> Arc { + Arc::new(Self { + length: Mutex::new(None), + lanes: Mutex::new(None), + memory: Mutex::new(None), + iterations: Mutex::new(None), + variant: Mutex::new(None), + version: Mutex::new(None), + dc_version: Mutex::new(None), + associated_data: Mutex::new(None), + secret_key: Mutex::new(None), + salt: Mutex::new(None), + }) + } -#[UniffiBuilder(Argon2Parameters, devolutions_crypto::argon2parameters_defaults)] -pub struct Argon2ParametersBuilder { - length: u32, - lanes: u32, - memory: u32, - iterations: u32, - variant: Argon2Variant, - version: Argon2Version, - dc_version: u32, - - #[builder_default = Default::default()] - associated_data: Vec, - - #[builder_default = Default::default()] - secret_key: Vec, - - #[builder_default = devolutions_crypto::argon2parameters_defaults::salt().unwrap()] - salt: Vec, + pub fn length(self: Arc, value: u32) -> Arc { + *self.length.lock().unwrap() = Some(value); + self + } + + pub fn lanes(self: Arc, value: u32) -> Arc { + *self.lanes.lock().unwrap() = Some(value); + self + } + + pub fn memory(self: Arc, value: u32) -> Arc { + *self.memory.lock().unwrap() = Some(value); + self + } + + pub fn iterations(self: Arc, value: u32) -> Arc { + *self.iterations.lock().unwrap() = Some(value); + self + } + + pub fn variant(self: Arc, value: Argon2Variant) -> Arc { + *self.variant.lock().unwrap() = Some(value); + self + } + + pub fn version(self: Arc, value: Argon2Version) -> Arc { + *self.version.lock().unwrap() = Some(value); + self + } + + pub fn dc_version(self: Arc, value: u32) -> Arc { + *self.dc_version.lock().unwrap() = Some(value); + self + } + + pub fn associated_data(self: Arc, value: Vec) -> Arc { + *self.associated_data.lock().unwrap() = Some(value); + self + } + + pub fn secret_key(self: Arc, value: Vec) -> Arc { + *self.secret_key.lock().unwrap() = Some(value); + self + } + + pub fn salt(self: Arc, value: Vec) -> Arc { + *self.salt.lock().unwrap() = Some(value); + self + } + + pub fn build(self: Arc) -> Arc { + let length = *self.length.lock().unwrap(); + let lanes = *self.lanes.lock().unwrap(); + let memory = *self.memory.lock().unwrap(); + let iterations = *self.iterations.lock().unwrap(); + let variant = *self.variant.lock().unwrap(); + let version = *self.version.lock().unwrap(); + let dc_version = *self.dc_version.lock().unwrap(); + let associated_data = self.associated_data.lock().unwrap().clone(); + let secret_key = self.secret_key.lock().unwrap().clone(); + let salt = self.salt.lock().unwrap().clone(); + + let inner = + devolutions_crypto::Argon2Parameters::builder() + .length(length.unwrap_or(32)) + .lanes(lanes.unwrap_or(1)) + .memory(memory.unwrap_or(4096)) + .iterations(iterations.unwrap_or(3)) + .variant( + variant + .map(|v| v.into()) + .unwrap_or(argon2::Variant::Argon2id), + ) + .version( + version + .map(|v| v.into()) + .unwrap_or(argon2::Version::Version13), + ) + .dc_version(dc_version.unwrap_or(1)) + .associated_data(associated_data.unwrap_or_default()) + .secret_key(secret_key.unwrap_or_default()) + .salt(salt.unwrap_or_else(|| { + devolutions_crypto::argon2parameters_defaults::salt().unwrap() + })) + .build(); + + Arc::new(Argon2Parameters { inner }) + } } -pub struct Argon2Parameters(pub devolutions_crypto::Argon2Parameters); +#[derive(uniffi::Object)] +pub struct Argon2Parameters { + pub(crate) inner: devolutions_crypto::Argon2Parameters, +} +#[uniffi::export] impl Argon2Parameters { - pub fn new_from_bytes(data: &[u8]) -> Result { - let data = data.try_into()?; - Ok(Self(data)) + #[uniffi::constructor] + pub fn new_from_bytes(data: &[u8]) -> Result> { + let inner = data.try_into()?; + Ok(Arc::new(Self { inner })) } pub fn get_bytes(&self) -> Vec { - (&self.0).into() - } - - fn get_inner_builder() -> devolutions_crypto::Argon2ParametersBuilder { - devolutions_crypto::Argon2Parameters::builder() + (&self.inner).into() } } diff --git a/uniffi/devolutions-crypto-uniffi/src/ciphertext.rs b/uniffi/devolutions-crypto-uniffi/src/ciphertext.rs index 8ed09fc46..eb96487ff 100644 --- a/uniffi/devolutions-crypto-uniffi/src/ciphertext.rs +++ b/uniffi/devolutions-crypto-uniffi/src/ciphertext.rs @@ -1,16 +1,20 @@ use crate::CiphertextVersion; use crate::Result; -pub fn encrypt(data: &[u8], key: &[u8], version: CiphertextVersion) -> Result> { +#[uniffi::export(default(version = None))] +pub fn encrypt(data: &[u8], key: &[u8], version: Option) -> Result> { + let version = version.unwrap_or(CiphertextVersion::Latest); Ok(devolutions_crypto::ciphertext::encrypt(data, key, version)?.into()) } +#[uniffi::export(default(version = None))] pub fn encrypt_with_aad( data: &[u8], key: &[u8], aad: &[u8], - version: CiphertextVersion, + version: Option, ) -> Result> { + let version = version.unwrap_or(CiphertextVersion::Latest); Ok(devolutions_crypto::ciphertext::encrypt_with_aad(data, key, aad, version)?.into()) } @@ -26,17 +30,25 @@ fn decrypt_with_aad(data: &[u8], key: &[u8], aad: &[u8]) -> Result> { data.decrypt_with_aad(key, aad) } -pub fn encrypt_asymmetric(data: &[u8], key: &[u8], version: CiphertextVersion) -> Result> { +#[uniffi::export(default(version = None))] +pub fn encrypt_asymmetric( + data: &[u8], + key: &[u8], + version: Option, +) -> Result> { + let version = version.unwrap_or(CiphertextVersion::Latest); let key = key.try_into()?; Ok(devolutions_crypto::ciphertext::encrypt_asymmetric(data, &key, version)?.into()) } +#[uniffi::export(default(version = None))] pub fn encrypt_asymmetric_with_aad( data: &[u8], key: &[u8], aad: &[u8], - version: CiphertextVersion, + version: Option, ) -> Result> { + let version = version.unwrap_or(CiphertextVersion::Latest); let key = key.try_into()?; Ok( devolutions_crypto::ciphertext::encrypt_asymmetric_with_aad(data, &key, aad, version)? diff --git a/uniffi/devolutions-crypto-uniffi/src/devolutions_crypto.udl b/uniffi/devolutions-crypto-uniffi/src/devolutions_crypto.udl deleted file mode 100644 index ffb3e16bb..000000000 --- a/uniffi/devolutions-crypto-uniffi/src/devolutions_crypto.udl +++ /dev/null @@ -1,160 +0,0 @@ -[Remote] -enum DataType { - "None", - "Key", - "Ciphertext", - "PasswordHash", - "Share", - "SigningKey", - "Signature", - "OnlineCiphertext", -}; - -[Remote] -enum CiphertextVersion { - "Latest", - "V1", - "V2", -}; - -[Remote] -enum PasswordHashVersion { - "Latest", - "V1", -}; - -[Remote] -enum KeyVersion { - "Latest", - "V1", -}; - -[Remote] -enum SigningKeyVersion { - "Latest", - "V1", -}; - -[Remote] -enum SecretSharingVersion { - "Latest", - "V1", -}; - -[Remote] -enum SignatureVersion { - "Latest", - "V1", -}; - -[Remote] -enum Argon2Version { - "Version10", - "Version13", -}; - -[Remote] -enum Argon2Variant { - "Argon2d", - "Argon2i", - "Argon2id", -}; - -[Error, Remote] -enum DevolutionsCryptoError { - "InvalidLength", - "InvalidKeyLength", - "InvalidOutputLength", - "InvalidSignature", - "InvalidMac", - "InvalidDataType", - "UnknownType", - "UnknownSubtype", - "UnknownVersion", - "InvalidData", - "NullPointer", - "CryptoError", - "RandomError", - "IoError", - "NotEnoughShares", - "InconsistentVersion", - "InvalidChunkLength", - "PoisonedMutex", -}; - -interface Argon2ParametersBuilder { - constructor(); - [Self=ByArc] - Argon2ParametersBuilder length(u32 value); - [Self=ByArc] - Argon2ParametersBuilder lanes(u32 value); - [Self=ByArc] - Argon2ParametersBuilder memory(u32 value); - [Self=ByArc] - Argon2ParametersBuilder iterations(u32 value); - [Self=ByArc] - Argon2ParametersBuilder variant(Argon2Variant value); - [Self=ByArc] - Argon2ParametersBuilder version(Argon2Version value); - [Self=ByArc] - Argon2ParametersBuilder dc_version(u32 value); - [Self=ByArc] - Argon2ParametersBuilder associated_data(bytes value); - [Self=ByArc] - Argon2ParametersBuilder secret_key(bytes value); - [Self=ByArc] - Argon2ParametersBuilder salt(bytes value); - [Self=ByArc] - Argon2Parameters build(); -}; - -interface Argon2Parameters { - [Name=new_from_bytes, Throws=DevolutionsCryptoError] - constructor([ByRef] bytes data); - bytes get_bytes(); -}; - -dictionary KeyPair { - bytes public_key; - bytes private_key; -}; - -interface SigningKeyPair { - [Name=new_from_bytes, Throws=DevolutionsCryptoError] - constructor([ByRef] bytes data); - bytes get_public_key(); - bytes get_private_key(); -}; - -namespace devolutions_crypto { - // Ciphertext - [Throws=DevolutionsCryptoError] - bytes encrypt([ByRef] bytes data, [ByRef] bytes key, optional CiphertextVersion version = "Latest"); - - [Throws=DevolutionsCryptoError] - bytes encrypt_with_aad([ByRef] bytes data, [ByRef] bytes key, [ByRef] bytes aad, optional CiphertextVersion version = "Latest"); - - [Throws=DevolutionsCryptoError] - bytes encrypt_asymmetric([ByRef] bytes data, [ByRef] bytes key, optional CiphertextVersion version = "Latest"); - - [Throws=DevolutionsCryptoError] - bytes encrypt_asymmetric_with_aad([ByRef] bytes data, [ByRef] bytes key, [ByRef] bytes aad, optional CiphertextVersion version = "Latest"); - - // Keys - KeyPair generate_keypair(optional KeyVersion version = "Latest"); - - // Password Hash - [Throws=DevolutionsCryptoError] - bytes hash_password([ByRef] bytes password, optional u32 iterations = 10000, optional PasswordHashVersion version = "Latest"); - - // Secret Sharing - [Throws=DevolutionsCryptoError] - sequence generate_shared_key(u8 n_shares, u8 threshold, optional u32 length = 32, optional SecretSharingVersion version = "Latest"); - - // Signature - [Throws=DevolutionsCryptoError] - bytes sign([ByRef] bytes data, [ByRef] bytes keypair, optional SignatureVersion version = "Latest"); - - // Signing Key - SigningKeyPair generate_signing_keypair(optional SigningKeyVersion version = "Latest"); -}; \ No newline at end of file diff --git a/uniffi/devolutions-crypto-uniffi/src/key.rs b/uniffi/devolutions-crypto-uniffi/src/key.rs index 59eed6243..cbfb43544 100644 --- a/uniffi/devolutions-crypto-uniffi/src/key.rs +++ b/uniffi/devolutions-crypto-uniffi/src/key.rs @@ -1,6 +1,7 @@ use crate::KeyVersion; use crate::Result; +#[derive(uniffi::Record)] pub struct KeyPair { pub private_key: Vec, pub public_key: Vec, @@ -15,7 +16,9 @@ impl From for KeyPair { } } -pub fn generate_keypair(version: KeyVersion) -> KeyPair { +#[uniffi::export(default(version = None))] +pub fn generate_keypair(version: Option) -> KeyPair { + let version = version.unwrap_or(KeyVersion::Latest); devolutions_crypto::key::generate_keypair(version).into() } diff --git a/uniffi/devolutions-crypto-uniffi/src/lib.rs b/uniffi/devolutions-crypto-uniffi/src/lib.rs index 55c644d85..5adbf04e2 100644 --- a/uniffi/devolutions-crypto-uniffi/src/lib.rs +++ b/uniffi/devolutions-crypto-uniffi/src/lib.rs @@ -16,8 +16,7 @@ pub use signature::*; pub use signing_key::*; pub use utils::*; -pub use devolutions_crypto::Argon2Variant; -pub use devolutions_crypto::Argon2Version; +// Re-export types from devolutions_crypto pub use devolutions_crypto::CiphertextVersion; pub use devolutions_crypto::DataType; pub use devolutions_crypto::Error as DevolutionsCryptoError; @@ -29,4 +28,56 @@ pub use devolutions_crypto::SigningKeyVersion; pub use devolutions_crypto::Result; -uniffi::include_scaffolding!("devolutions_crypto"); +// Wrapper types for Argon2 enums from rust-argon2 crate +#[derive(uniffi::Enum, Clone, Copy, Debug, PartialEq, Eq)] +pub enum Argon2Version { + Version10, + Version13, +} + +impl From for argon2::Version { + fn from(version: Argon2Version) -> Self { + match version { + Argon2Version::Version10 => argon2::Version::Version10, + Argon2Version::Version13 => argon2::Version::Version13, + } + } +} + +impl From for Argon2Version { + fn from(version: argon2::Version) -> Self { + match version { + argon2::Version::Version10 => Argon2Version::Version10, + argon2::Version::Version13 => Argon2Version::Version13, + } + } +} + +#[derive(uniffi::Enum, Clone, Copy, Debug, PartialEq, Eq)] +pub enum Argon2Variant { + Argon2d, + Argon2i, + Argon2id, +} + +impl From for argon2::Variant { + fn from(variant: Argon2Variant) -> Self { + match variant { + Argon2Variant::Argon2d => argon2::Variant::Argon2d, + Argon2Variant::Argon2i => argon2::Variant::Argon2i, + Argon2Variant::Argon2id => argon2::Variant::Argon2id, + } + } +} + +impl From for Argon2Variant { + fn from(variant: argon2::Variant) -> Self { + match variant { + argon2::Variant::Argon2d => Argon2Variant::Argon2d, + argon2::Variant::Argon2i => Argon2Variant::Argon2i, + argon2::Variant::Argon2id => Argon2Variant::Argon2id, + } + } +} + +uniffi::setup_scaffolding!(); diff --git a/uniffi/devolutions-crypto-uniffi/src/password_hash.rs b/uniffi/devolutions-crypto-uniffi/src/password_hash.rs index 85b5f40dc..7bd58ad09 100644 --- a/uniffi/devolutions-crypto-uniffi/src/password_hash.rs +++ b/uniffi/devolutions-crypto-uniffi/src/password_hash.rs @@ -1,11 +1,13 @@ use crate::PasswordHashVersion; use crate::Result; +#[uniffi::export(default(iterations = 10000, version = None))] pub fn hash_password( password: &[u8], iterations: u32, - version: PasswordHashVersion, + version: Option, ) -> Result> { + let version = version.unwrap_or(PasswordHashVersion::Latest); Ok(devolutions_crypto::password_hash::hash_password(password, iterations, version)?.into()) } diff --git a/uniffi/devolutions-crypto-uniffi/src/secret_sharing.rs b/uniffi/devolutions-crypto-uniffi/src/secret_sharing.rs index 89e6ea58c..98bb0019a 100644 --- a/uniffi/devolutions-crypto-uniffi/src/secret_sharing.rs +++ b/uniffi/devolutions-crypto-uniffi/src/secret_sharing.rs @@ -1,12 +1,14 @@ use crate::Result; use crate::SecretSharingVersion; +#[uniffi::export(default(length = 32, version = None))] pub fn generate_shared_key( n_shares: u8, threshold: u8, length: u32, - version: SecretSharingVersion, + version: Option, ) -> Result>> { + let version = version.unwrap_or(SecretSharingVersion::Latest); Ok(devolutions_crypto::secret_sharing::generate_shared_key( n_shares, threshold, diff --git a/uniffi/devolutions-crypto-uniffi/src/signature.rs b/uniffi/devolutions-crypto-uniffi/src/signature.rs index c7ad08216..1635a0cc2 100644 --- a/uniffi/devolutions-crypto-uniffi/src/signature.rs +++ b/uniffi/devolutions-crypto-uniffi/src/signature.rs @@ -1,7 +1,9 @@ use crate::Result; use crate::SignatureVersion; -pub fn sign(data: &[u8], keypair: &[u8], version: SignatureVersion) -> Result> { +#[uniffi::export(default(version = None))] +pub fn sign(data: &[u8], keypair: &[u8], version: Option) -> Result> { + let version = version.unwrap_or(SignatureVersion::Latest); let keypair = keypair.try_into()?; Ok(devolutions_crypto::signature::sign(data, &keypair, version).into()) diff --git a/uniffi/devolutions-crypto-uniffi/src/signing_key.rs b/uniffi/devolutions-crypto-uniffi/src/signing_key.rs index 05a698ec8..ddcca1c81 100644 --- a/uniffi/devolutions-crypto-uniffi/src/signing_key.rs +++ b/uniffi/devolutions-crypto-uniffi/src/signing_key.rs @@ -4,11 +4,23 @@ use crate::DevolutionsCryptoError; use crate::Result; use crate::SigningKeyVersion; +#[derive(uniffi::Object)] pub struct SigningKeyPair(devolutions_crypto::signing_key::SigningKeyPair); +#[uniffi::export] impl SigningKeyPair { - pub fn new_from_bytes(data: &[u8]) -> Result { - data.try_into() + #[uniffi::constructor] + pub fn new_from_bytes(data: &[u8]) -> Result> { + let inner = data.try_into()?; + Ok(Arc::new(Self(inner))) + } + + pub fn get_public_key(&self) -> Vec { + self.0.get_public_key().into() + } + + pub fn get_private_key(&self) -> Vec { + self.0.clone().into() } } @@ -26,16 +38,8 @@ impl TryFrom<&[u8]> for SigningKeyPair { } } -impl SigningKeyPair { - pub fn get_public_key(&self) -> Vec { - self.0.get_public_key().into() - } - - pub fn get_private_key(&self) -> Vec { - self.0.clone().into() - } -} - -pub fn generate_signing_keypair(version: SigningKeyVersion) -> Arc { +#[uniffi::export(default(version = None))] +pub fn generate_signing_keypair(version: Option) -> Arc { + let version = version.unwrap_or(SigningKeyVersion::Latest); Arc::new(devolutions_crypto::signing_key::generate_signing_keypair(version).into()) } diff --git a/uniffi/devolutions-crypto-uniffi/src/utils.rs b/uniffi/devolutions-crypto-uniffi/src/utils.rs index 427de4b33..e00e0037b 100644 --- a/uniffi/devolutions-crypto-uniffi/src/utils.rs +++ b/uniffi/devolutions-crypto-uniffi/src/utils.rs @@ -24,7 +24,7 @@ pub fn derive_key_pbkdf2( #[uniffi::export] pub fn derive_key_argon2(key: &[u8], parameters: &Arc) -> Result> { - devolutions_crypto::utils::derive_key_argon2(key, ¶meters.0) + devolutions_crypto::utils::derive_key_argon2(key, ¶meters.inner) } #[uniffi::export] diff --git a/wrappers/kotlin/lib/src/test/kotlin/org/devolutions/crypto/AsymmetricTest.kt b/wrappers/kotlin/lib/src/test/kotlin/org/devolutions/crypto/AsymmetricTest.kt index e49b216cf..ba04522c0 100644 --- a/wrappers/kotlin/lib/src/test/kotlin/org/devolutions/crypto/AsymmetricTest.kt +++ b/wrappers/kotlin/lib/src/test/kotlin/org/devolutions/crypto/AsymmetricTest.kt @@ -7,6 +7,7 @@ import kotlin.test.Test import kotlin.test.assertContentEquals import kotlin.test.assertEquals import kotlin.test.assertFailsWith +import uniffi.devolutions_crypto.Exception class AsymmetricTest { @Test @@ -55,7 +56,7 @@ class AsymmetricTest { val encrypted = encryptAsymmetricWithAad(data, keypair.publicKey, aad) - assertFailsWith { + assertFailsWith { decryptAsymmetricWithAad(encrypted, keypair.privateKey, wrongAad) } } diff --git a/wrappers/kotlin/lib/src/test/kotlin/org/devolutions/crypto/SecretSharingTest.kt b/wrappers/kotlin/lib/src/test/kotlin/org/devolutions/crypto/SecretSharingTest.kt index 003c81be9..0edcb8ecb 100644 --- a/wrappers/kotlin/lib/src/test/kotlin/org/devolutions/crypto/SecretSharingTest.kt +++ b/wrappers/kotlin/lib/src/test/kotlin/org/devolutions/crypto/SecretSharingTest.kt @@ -7,6 +7,7 @@ import org.junit.jupiter.api.assertThrows import kotlin.test.Test import kotlin.test.assertContentEquals import kotlin.test.assertEquals +import uniffi.devolutions_crypto.Exception class SecretSharingTest { @Test @@ -47,7 +48,7 @@ class SecretSharingTest { @Test fun sharedSecretWrongParamsTest() { - assertThrows { + assertThrows { generateSharedKey(3u, 5u) } } @@ -56,7 +57,7 @@ class SecretSharingTest { fun sharedSecrectNotEnoughShare() { val shares = generateSharedKey(5u, 3u) val sharesGroup = shares.slice(0..1) - assertThrows { + assertThrows { joinShares(sharesGroup) } } diff --git a/wrappers/kotlin/lib/src/test/kotlin/org/devolutions/crypto/SymmetricTest.kt b/wrappers/kotlin/lib/src/test/kotlin/org/devolutions/crypto/SymmetricTest.kt index 8c38d60ce..8c5c95e4f 100644 --- a/wrappers/kotlin/lib/src/test/kotlin/org/devolutions/crypto/SymmetricTest.kt +++ b/wrappers/kotlin/lib/src/test/kotlin/org/devolutions/crypto/SymmetricTest.kt @@ -6,6 +6,7 @@ package org.devolutions.crypto import kotlin.test.Test import kotlin.test.assertContentEquals import kotlin.test.assertFailsWith +import uniffi.devolutions_crypto.Exception class SymmetricTest { @Test @@ -44,7 +45,7 @@ class SymmetricTest { val encrypted = encryptWithAad(data, key, aad) - assertFailsWith { + assertFailsWith { decryptWithAad(encrypted, key, wrongAad) } } diff --git a/wrappers/kotlin/lib/src/test/kotlin/org/devolutions/crypto/UtilsTest.kt b/wrappers/kotlin/lib/src/test/kotlin/org/devolutions/crypto/UtilsTest.kt index c545844f7..1685fd663 100644 --- a/wrappers/kotlin/lib/src/test/kotlin/org/devolutions/crypto/UtilsTest.kt +++ b/wrappers/kotlin/lib/src/test/kotlin/org/devolutions/crypto/UtilsTest.kt @@ -6,6 +6,7 @@ package org.devolutions.crypto import kotlin.test.Test import kotlin.test.assertContentEquals import kotlin.test.assertEquals +import uniffi.devolutions_crypto.DataType class UtilsTest { @Test diff --git a/wrappers/swift/DevolutionsCryptoSwift/Sources/DevolutionsCryptoSwift/DevolutionsCryptoSwift.swift b/wrappers/swift/DevolutionsCryptoSwift/Sources/DevolutionsCryptoSwift/DevolutionsCryptoSwift.swift deleted file mode 100644 index b16664787..000000000 --- a/wrappers/swift/DevolutionsCryptoSwift/Sources/DevolutionsCryptoSwift/DevolutionsCryptoSwift.swift +++ /dev/null @@ -1,2365 +0,0 @@ -// This file was autogenerated by some hot garbage in the `uniffi` crate. -// Trust me, you don't want to mess with it! - -// swiftlint:disable all -import Foundation - -// Depending on the consumer's build setup, the low-level FFI code -// might be in a separate module, or it might be compiled inline into -// this module. This is a bit of light hackery to work with both. -#if canImport(devolutions_cryptoFFI) -import devolutions_cryptoFFI -#endif - -fileprivate extension RustBuffer { - // Allocate a new buffer, copying the contents of a `UInt8` array. - init(bytes: [UInt8]) { - let rbuf = bytes.withUnsafeBufferPointer { ptr in - RustBuffer.from(ptr) - } - self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data) - } - - static func empty() -> RustBuffer { - RustBuffer(capacity: 0, len:0, data: nil) - } - - static func from(_ ptr: UnsafeBufferPointer) -> RustBuffer { - try! rustCall { ffi_devolutions_crypto_uniffi_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) } - } - - // Frees the buffer in place. - // The buffer must not be used after this is called. - func deallocate() { - try! rustCall { ffi_devolutions_crypto_uniffi_rustbuffer_free(self, $0) } - } -} - -fileprivate extension ForeignBytes { - init(bufferPointer: UnsafeBufferPointer) { - self.init(len: Int32(bufferPointer.count), data: bufferPointer.baseAddress) - } -} - -// For every type used in the interface, we provide helper methods for conveniently -// lifting and lowering that type from C-compatible data, and for reading and writing -// values of that type in a buffer. - -// Helper classes/extensions that don't change. -// Someday, this will be in a library of its own. - -fileprivate extension Data { - init(rustBuffer: RustBuffer) { - self.init( - bytesNoCopy: rustBuffer.data!, - count: Int(rustBuffer.len), - deallocator: .none - ) - } -} - -// Define reader functionality. Normally this would be defined in a class or -// struct, but we use standalone functions instead in order to make external -// types work. -// -// With external types, one swift source file needs to be able to call the read -// method on another source file's FfiConverter, but then what visibility -// should Reader have? -// - If Reader is fileprivate, then this means the read() must also -// be fileprivate, which doesn't work with external types. -// - If Reader is internal/public, we'll get compile errors since both source -// files will try define the same type. -// -// Instead, the read() method and these helper functions input a tuple of data - -fileprivate func createReader(data: Data) -> (data: Data, offset: Data.Index) { - (data: data, offset: 0) -} - -// Reads an integer at the current offset, in big-endian order, and advances -// the offset on success. Throws if reading the integer would move the -// offset past the end of the buffer. -fileprivate func readInt(_ reader: inout (data: Data, offset: Data.Index)) throws -> T { - let range = reader.offset...size - guard reader.data.count >= range.upperBound else { - throw UniffiInternalError.bufferOverflow - } - if T.self == UInt8.self { - let value = reader.data[reader.offset] - reader.offset += 1 - return value as! T - } - var value: T = 0 - let _ = withUnsafeMutableBytes(of: &value, { reader.data.copyBytes(to: $0, from: range)}) - reader.offset = range.upperBound - return value.bigEndian -} - -// Reads an arbitrary number of bytes, to be used to read -// raw bytes, this is useful when lifting strings -fileprivate func readBytes(_ reader: inout (data: Data, offset: Data.Index), count: Int) throws -> Array { - let range = reader.offset..<(reader.offset+count) - guard reader.data.count >= range.upperBound else { - throw UniffiInternalError.bufferOverflow - } - var value = [UInt8](repeating: 0, count: count) - value.withUnsafeMutableBufferPointer({ buffer in - reader.data.copyBytes(to: buffer, from: range) - }) - reader.offset = range.upperBound - return value -} - -// Reads a float at the current offset. -fileprivate func readFloat(_ reader: inout (data: Data, offset: Data.Index)) throws -> Float { - return Float(bitPattern: try readInt(&reader)) -} - -// Reads a float at the current offset. -fileprivate func readDouble(_ reader: inout (data: Data, offset: Data.Index)) throws -> Double { - return Double(bitPattern: try readInt(&reader)) -} - -// Indicates if the offset has reached the end of the buffer. -fileprivate func hasRemaining(_ reader: (data: Data, offset: Data.Index)) -> Bool { - return reader.offset < reader.data.count -} - -// Define writer functionality. Normally this would be defined in a class or -// struct, but we use standalone functions instead in order to make external -// types work. See the above discussion on Readers for details. - -fileprivate func createWriter() -> [UInt8] { - return [] -} - -fileprivate func writeBytes(_ writer: inout [UInt8], _ byteArr: S) where S: Sequence, S.Element == UInt8 { - writer.append(contentsOf: byteArr) -} - -// Writes an integer in big-endian order. -// -// Warning: make sure what you are trying to write -// is in the correct type! -fileprivate func writeInt(_ writer: inout [UInt8], _ value: T) { - var value = value.bigEndian - withUnsafeBytes(of: &value) { writer.append(contentsOf: $0) } -} - -fileprivate func writeFloat(_ writer: inout [UInt8], _ value: Float) { - writeInt(&writer, value.bitPattern) -} - -fileprivate func writeDouble(_ writer: inout [UInt8], _ value: Double) { - writeInt(&writer, value.bitPattern) -} - -// Protocol for types that transfer other types across the FFI. This is -// analogous to the Rust trait of the same name. -fileprivate protocol FfiConverter { - associatedtype FfiType - associatedtype SwiftType - - static func lift(_ value: FfiType) throws -> SwiftType - static func lower(_ value: SwiftType) -> FfiType - static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType - static func write(_ value: SwiftType, into buf: inout [UInt8]) -} - -// Types conforming to `Primitive` pass themselves directly over the FFI. -fileprivate protocol FfiConverterPrimitive: FfiConverter where FfiType == SwiftType { } - -extension FfiConverterPrimitive { -#if swift(>=5.8) - @_documentation(visibility: private) -#endif - public static func lift(_ value: FfiType) throws -> SwiftType { - return value - } - -#if swift(>=5.8) - @_documentation(visibility: private) -#endif - public static func lower(_ value: SwiftType) -> FfiType { - return value - } -} - -// Types conforming to `FfiConverterRustBuffer` lift and lower into a `RustBuffer`. -// Used for complex types where it's hard to write a custom lift/lower. -fileprivate protocol FfiConverterRustBuffer: FfiConverter where FfiType == RustBuffer {} - -extension FfiConverterRustBuffer { -#if swift(>=5.8) - @_documentation(visibility: private) -#endif - public static func lift(_ buf: RustBuffer) throws -> SwiftType { - var reader = createReader(data: Data(rustBuffer: buf)) - let value = try read(from: &reader) - if hasRemaining(reader) { - throw UniffiInternalError.incompleteData - } - buf.deallocate() - return value - } - -#if swift(>=5.8) - @_documentation(visibility: private) -#endif - public static func lower(_ value: SwiftType) -> RustBuffer { - var writer = createWriter() - write(value, into: &writer) - return RustBuffer(bytes: writer) - } -} -// An error type for FFI errors. These errors occur at the UniFFI level, not -// the library level. -fileprivate enum UniffiInternalError: LocalizedError { - case bufferOverflow - case incompleteData - case unexpectedOptionalTag - case unexpectedEnumCase - case unexpectedNullPointer - case unexpectedRustCallStatusCode - case unexpectedRustCallError - case unexpectedStaleHandle - case rustPanic(_ message: String) - - public var errorDescription: String? { - switch self { - case .bufferOverflow: return "Reading the requested value would read past the end of the buffer" - case .incompleteData: return "The buffer still has data after lifting its containing value" - case .unexpectedOptionalTag: return "Unexpected optional tag; should be 0 or 1" - case .unexpectedEnumCase: return "Raw enum value doesn't match any cases" - case .unexpectedNullPointer: return "Raw pointer value was null" - case .unexpectedRustCallStatusCode: return "Unexpected RustCallStatus code" - case .unexpectedRustCallError: return "CALL_ERROR but no errorClass specified" - case .unexpectedStaleHandle: return "The object in the handle map has been dropped already" - case let .rustPanic(message): return message - } - } -} - -fileprivate extension NSLock { - func withLock(f: () throws -> T) rethrows -> T { - self.lock() - defer { self.unlock() } - return try f() - } -} - -fileprivate let CALL_SUCCESS: Int8 = 0 -fileprivate let CALL_ERROR: Int8 = 1 -fileprivate let CALL_UNEXPECTED_ERROR: Int8 = 2 -fileprivate let CALL_CANCELLED: Int8 = 3 - -fileprivate extension RustCallStatus { - init() { - self.init( - code: CALL_SUCCESS, - errorBuf: RustBuffer.init( - capacity: 0, - len: 0, - data: nil - ) - ) - } -} - -private func rustCall(_ callback: (UnsafeMutablePointer) -> T) throws -> T { - let neverThrow: ((RustBuffer) throws -> Never)? = nil - return try makeRustCall(callback, errorHandler: neverThrow) -} - -private func rustCallWithError( - _ errorHandler: @escaping (RustBuffer) throws -> E, - _ callback: (UnsafeMutablePointer) -> T) throws -> T { - try makeRustCall(callback, errorHandler: errorHandler) -} - -private func makeRustCall( - _ callback: (UnsafeMutablePointer) -> T, - errorHandler: ((RustBuffer) throws -> E)? -) throws -> T { - uniffiEnsureDevolutionsCryptoUniffiInitialized() - var callStatus = RustCallStatus.init() - let returnedVal = callback(&callStatus) - try uniffiCheckCallStatus(callStatus: callStatus, errorHandler: errorHandler) - return returnedVal -} - -private func uniffiCheckCallStatus( - callStatus: RustCallStatus, - errorHandler: ((RustBuffer) throws -> E)? -) throws { - switch callStatus.code { - case CALL_SUCCESS: - return - - case CALL_ERROR: - if let errorHandler = errorHandler { - throw try errorHandler(callStatus.errorBuf) - } else { - callStatus.errorBuf.deallocate() - throw UniffiInternalError.unexpectedRustCallError - } - - case CALL_UNEXPECTED_ERROR: - // When the rust code sees a panic, it tries to construct a RustBuffer - // with the message. But if that code panics, then it just sends back - // an empty buffer. - if callStatus.errorBuf.len > 0 { - throw UniffiInternalError.rustPanic(try FfiConverterString.lift(callStatus.errorBuf)) - } else { - callStatus.errorBuf.deallocate() - throw UniffiInternalError.rustPanic("Rust panic") - } - - case CALL_CANCELLED: - fatalError("Cancellation not supported yet") - - default: - throw UniffiInternalError.unexpectedRustCallStatusCode - } -} - -private func uniffiTraitInterfaceCall( - callStatus: UnsafeMutablePointer, - makeCall: () throws -> T, - writeReturn: (T) -> () -) { - do { - try writeReturn(makeCall()) - } catch let error { - callStatus.pointee.code = CALL_UNEXPECTED_ERROR - callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error)) - } -} - -private func uniffiTraitInterfaceCallWithError( - callStatus: UnsafeMutablePointer, - makeCall: () throws -> T, - writeReturn: (T) -> (), - lowerError: (E) -> RustBuffer -) { - do { - try writeReturn(makeCall()) - } catch let error as E { - callStatus.pointee.code = CALL_ERROR - callStatus.pointee.errorBuf = lowerError(error) - } catch { - callStatus.pointee.code = CALL_UNEXPECTED_ERROR - callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error)) - } -} -fileprivate final class UniffiHandleMap: @unchecked Sendable { - // All mutation happens with this lock held, which is why we implement @unchecked Sendable. - private let lock = NSLock() - private var map: [UInt64: T] = [:] - private var currentHandle: UInt64 = 1 - - func insert(obj: T) -> UInt64 { - lock.withLock { - let handle = currentHandle - currentHandle += 1 - map[handle] = obj - return handle - } - } - - func get(handle: UInt64) throws -> T { - try lock.withLock { - guard let obj = map[handle] else { - throw UniffiInternalError.unexpectedStaleHandle - } - return obj - } - } - - @discardableResult - func remove(handle: UInt64) throws -> T { - try lock.withLock { - guard let obj = map.removeValue(forKey: handle) else { - throw UniffiInternalError.unexpectedStaleHandle - } - return obj - } - } - - var count: Int { - get { - map.count - } - } -} - - -// Public interface members begin here. - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -fileprivate struct FfiConverterUInt8: FfiConverterPrimitive { - typealias FfiType = UInt8 - typealias SwiftType = UInt8 - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UInt8 { - return try lift(readInt(&buf)) - } - - public static func write(_ value: UInt8, into buf: inout [UInt8]) { - writeInt(&buf, lower(value)) - } -} - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -fileprivate struct FfiConverterUInt32: FfiConverterPrimitive { - typealias FfiType = UInt32 - typealias SwiftType = UInt32 - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UInt32 { - return try lift(readInt(&buf)) - } - - public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - writeInt(&buf, lower(value)) - } -} - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -fileprivate struct FfiConverterBool : FfiConverter { - typealias FfiType = Int8 - typealias SwiftType = Bool - - public static func lift(_ value: Int8) throws -> Bool { - return value != 0 - } - - public static func lower(_ value: Bool) -> Int8 { - return value ? 1 : 0 - } - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Bool { - return try lift(readInt(&buf)) - } - - public static func write(_ value: Bool, into buf: inout [UInt8]) { - writeInt(&buf, lower(value)) - } -} - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -fileprivate struct FfiConverterString: FfiConverter { - typealias SwiftType = String - typealias FfiType = RustBuffer - - public static func lift(_ value: RustBuffer) throws -> String { - defer { - value.deallocate() - } - if value.data == nil { - return String() - } - let bytes = UnsafeBufferPointer(start: value.data!, count: Int(value.len)) - return String(bytes: bytes, encoding: String.Encoding.utf8)! - } - - public static func lower(_ value: String) -> RustBuffer { - return value.utf8CString.withUnsafeBufferPointer { ptr in - // The swift string gives us int8_t, we want uint8_t. - ptr.withMemoryRebound(to: UInt8.self) { ptr in - // The swift string gives us a trailing null byte, we don't want it. - let buf = UnsafeBufferPointer(rebasing: ptr.prefix(upTo: ptr.count - 1)) - return RustBuffer.from(buf) - } - } - } - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> String { - let len: Int32 = try readInt(&buf) - return String(bytes: try readBytes(&buf, count: Int(len)), encoding: String.Encoding.utf8)! - } - - public static func write(_ value: String, into buf: inout [UInt8]) { - let len = Int32(value.utf8.count) - writeInt(&buf, len) - writeBytes(&buf, value.utf8) - } -} - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -fileprivate struct FfiConverterData: FfiConverterRustBuffer { - typealias SwiftType = Data - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Data { - let len: Int32 = try readInt(&buf) - return Data(try readBytes(&buf, count: Int(len))) - } - - public static func write(_ value: Data, into buf: inout [UInt8]) { - let len = Int32(value.count) - writeInt(&buf, len) - writeBytes(&buf, value) - } -} - - - - -public protocol Argon2ParametersProtocol: AnyObject, Sendable { - - func getBytes() -> Data - -} -open class Argon2Parameters: Argon2ParametersProtocol, @unchecked Sendable { - fileprivate let pointer: UnsafeMutableRawPointer! - - /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. -#if swift(>=5.8) - @_documentation(visibility: private) -#endif - public struct NoPointer { - public init() {} - } - - // TODO: We'd like this to be `private` but for Swifty reasons, - // we can't implement `FfiConverter` without making this `required` and we can't - // make it `required` without making it `public`. -#if swift(>=5.8) - @_documentation(visibility: private) -#endif - required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { - self.pointer = pointer - } - - // This constructor can be used to instantiate a fake object. - // - Parameter noPointer: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject]. - // - // - Warning: - // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. -#if swift(>=5.8) - @_documentation(visibility: private) -#endif - public init(noPointer: NoPointer) { - self.pointer = nil - } - -#if swift(>=5.8) - @_documentation(visibility: private) -#endif - public func uniffiClonePointer() -> UnsafeMutableRawPointer { - return try! rustCall { uniffi_devolutions_crypto_uniffi_fn_clone_argon2parameters(self.pointer, $0) } - } - // No primary constructor declared for this class. - - deinit { - guard let pointer = pointer else { - return - } - - try! rustCall { uniffi_devolutions_crypto_uniffi_fn_free_argon2parameters(pointer, $0) } - } - - -public static func newFromBytes(data: Data)throws -> Argon2Parameters { - return try FfiConverterTypeArgon2Parameters_lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_constructor_argon2parameters_new_from_bytes( - FfiConverterData.lower(data),$0 - ) -}) -} - - - -open func getBytes() -> Data { - return try! FfiConverterData.lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_method_argon2parameters_get_bytes(self.uniffiClonePointer(),$0 - ) -}) -} - - -} - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public struct FfiConverterTypeArgon2Parameters: FfiConverter { - - typealias FfiType = UnsafeMutableRawPointer - typealias SwiftType = Argon2Parameters - - public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> Argon2Parameters { - return Argon2Parameters(unsafeFromRawPointer: pointer) - } - - public static func lower(_ value: Argon2Parameters) -> UnsafeMutableRawPointer { - return value.uniffiClonePointer() - } - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Argon2Parameters { - let v: UInt64 = try readInt(&buf) - // The Rust code won't compile if a pointer won't fit in a UInt64. - // We have to go via `UInt` because that's the thing that's the size of a pointer. - let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if (ptr == nil) { - throw UniffiInternalError.unexpectedNullPointer - } - return try lift(ptr!) - } - - public static func write(_ value: Argon2Parameters, into buf: inout [UInt8]) { - // This fiddling is because `Int` is the thing that's the same size as a pointer. - // The Rust code won't compile if a pointer won't fit in a `UInt64`. - writeInt(&buf, UInt64(bitPattern: Int64(Int(bitPattern: lower(value))))) - } -} - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeArgon2Parameters_lift(_ pointer: UnsafeMutableRawPointer) throws -> Argon2Parameters { - return try FfiConverterTypeArgon2Parameters.lift(pointer) -} - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeArgon2Parameters_lower(_ value: Argon2Parameters) -> UnsafeMutableRawPointer { - return FfiConverterTypeArgon2Parameters.lower(value) -} - - - - - - -public protocol Argon2ParametersBuilderProtocol: AnyObject, Sendable { - - func associatedData(value: Data) -> Argon2ParametersBuilder - - func build() -> Argon2Parameters - - func dcVersion(value: UInt32) -> Argon2ParametersBuilder - - func iterations(value: UInt32) -> Argon2ParametersBuilder - - func lanes(value: UInt32) -> Argon2ParametersBuilder - - func length(value: UInt32) -> Argon2ParametersBuilder - - func memory(value: UInt32) -> Argon2ParametersBuilder - - func salt(value: Data) -> Argon2ParametersBuilder - - func secretKey(value: Data) -> Argon2ParametersBuilder - - func variant(value: Argon2Variant) -> Argon2ParametersBuilder - - func version(value: Argon2Version) -> Argon2ParametersBuilder - -} -open class Argon2ParametersBuilder: Argon2ParametersBuilderProtocol, @unchecked Sendable { - fileprivate let pointer: UnsafeMutableRawPointer! - - /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. -#if swift(>=5.8) - @_documentation(visibility: private) -#endif - public struct NoPointer { - public init() {} - } - - // TODO: We'd like this to be `private` but for Swifty reasons, - // we can't implement `FfiConverter` without making this `required` and we can't - // make it `required` without making it `public`. -#if swift(>=5.8) - @_documentation(visibility: private) -#endif - required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { - self.pointer = pointer - } - - // This constructor can be used to instantiate a fake object. - // - Parameter noPointer: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject]. - // - // - Warning: - // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. -#if swift(>=5.8) - @_documentation(visibility: private) -#endif - public init(noPointer: NoPointer) { - self.pointer = nil - } - -#if swift(>=5.8) - @_documentation(visibility: private) -#endif - public func uniffiClonePointer() -> UnsafeMutableRawPointer { - return try! rustCall { uniffi_devolutions_crypto_uniffi_fn_clone_argon2parametersbuilder(self.pointer, $0) } - } -public convenience init() { - let pointer = - try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_constructor_argon2parametersbuilder_new($0 - ) -} - self.init(unsafeFromRawPointer: pointer) -} - - deinit { - guard let pointer = pointer else { - return - } - - try! rustCall { uniffi_devolutions_crypto_uniffi_fn_free_argon2parametersbuilder(pointer, $0) } - } - - - - -open func associatedData(value: Data) -> Argon2ParametersBuilder { - return try! FfiConverterTypeArgon2ParametersBuilder_lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_associated_data(self.uniffiClonePointer(), - FfiConverterData.lower(value),$0 - ) -}) -} - -open func build() -> Argon2Parameters { - return try! FfiConverterTypeArgon2Parameters_lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_build(self.uniffiClonePointer(),$0 - ) -}) -} - -open func dcVersion(value: UInt32) -> Argon2ParametersBuilder { - return try! FfiConverterTypeArgon2ParametersBuilder_lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_dc_version(self.uniffiClonePointer(), - FfiConverterUInt32.lower(value),$0 - ) -}) -} - -open func iterations(value: UInt32) -> Argon2ParametersBuilder { - return try! FfiConverterTypeArgon2ParametersBuilder_lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_iterations(self.uniffiClonePointer(), - FfiConverterUInt32.lower(value),$0 - ) -}) -} - -open func lanes(value: UInt32) -> Argon2ParametersBuilder { - return try! FfiConverterTypeArgon2ParametersBuilder_lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_lanes(self.uniffiClonePointer(), - FfiConverterUInt32.lower(value),$0 - ) -}) -} - -open func length(value: UInt32) -> Argon2ParametersBuilder { - return try! FfiConverterTypeArgon2ParametersBuilder_lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_length(self.uniffiClonePointer(), - FfiConverterUInt32.lower(value),$0 - ) -}) -} - -open func memory(value: UInt32) -> Argon2ParametersBuilder { - return try! FfiConverterTypeArgon2ParametersBuilder_lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_memory(self.uniffiClonePointer(), - FfiConverterUInt32.lower(value),$0 - ) -}) -} - -open func salt(value: Data) -> Argon2ParametersBuilder { - return try! FfiConverterTypeArgon2ParametersBuilder_lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_salt(self.uniffiClonePointer(), - FfiConverterData.lower(value),$0 - ) -}) -} - -open func secretKey(value: Data) -> Argon2ParametersBuilder { - return try! FfiConverterTypeArgon2ParametersBuilder_lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_secret_key(self.uniffiClonePointer(), - FfiConverterData.lower(value),$0 - ) -}) -} - -open func variant(value: Argon2Variant) -> Argon2ParametersBuilder { - return try! FfiConverterTypeArgon2ParametersBuilder_lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_variant(self.uniffiClonePointer(), - FfiConverterTypeArgon2Variant_lower(value),$0 - ) -}) -} - -open func version(value: Argon2Version) -> Argon2ParametersBuilder { - return try! FfiConverterTypeArgon2ParametersBuilder_lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_version(self.uniffiClonePointer(), - FfiConverterTypeArgon2Version_lower(value),$0 - ) -}) -} - - -} - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public struct FfiConverterTypeArgon2ParametersBuilder: FfiConverter { - - typealias FfiType = UnsafeMutableRawPointer - typealias SwiftType = Argon2ParametersBuilder - - public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> Argon2ParametersBuilder { - return Argon2ParametersBuilder(unsafeFromRawPointer: pointer) - } - - public static func lower(_ value: Argon2ParametersBuilder) -> UnsafeMutableRawPointer { - return value.uniffiClonePointer() - } - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Argon2ParametersBuilder { - let v: UInt64 = try readInt(&buf) - // The Rust code won't compile if a pointer won't fit in a UInt64. - // We have to go via `UInt` because that's the thing that's the size of a pointer. - let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if (ptr == nil) { - throw UniffiInternalError.unexpectedNullPointer - } - return try lift(ptr!) - } - - public static func write(_ value: Argon2ParametersBuilder, into buf: inout [UInt8]) { - // This fiddling is because `Int` is the thing that's the same size as a pointer. - // The Rust code won't compile if a pointer won't fit in a `UInt64`. - writeInt(&buf, UInt64(bitPattern: Int64(Int(bitPattern: lower(value))))) - } -} - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeArgon2ParametersBuilder_lift(_ pointer: UnsafeMutableRawPointer) throws -> Argon2ParametersBuilder { - return try FfiConverterTypeArgon2ParametersBuilder.lift(pointer) -} - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeArgon2ParametersBuilder_lower(_ value: Argon2ParametersBuilder) -> UnsafeMutableRawPointer { - return FfiConverterTypeArgon2ParametersBuilder.lower(value) -} - - - - - - -public protocol SigningKeyPairProtocol: AnyObject, Sendable { - - func getPrivateKey() -> Data - - func getPublicKey() -> Data - -} -open class SigningKeyPair: SigningKeyPairProtocol, @unchecked Sendable { - fileprivate let pointer: UnsafeMutableRawPointer! - - /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. -#if swift(>=5.8) - @_documentation(visibility: private) -#endif - public struct NoPointer { - public init() {} - } - - // TODO: We'd like this to be `private` but for Swifty reasons, - // we can't implement `FfiConverter` without making this `required` and we can't - // make it `required` without making it `public`. -#if swift(>=5.8) - @_documentation(visibility: private) -#endif - required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { - self.pointer = pointer - } - - // This constructor can be used to instantiate a fake object. - // - Parameter noPointer: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject]. - // - // - Warning: - // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. -#if swift(>=5.8) - @_documentation(visibility: private) -#endif - public init(noPointer: NoPointer) { - self.pointer = nil - } - -#if swift(>=5.8) - @_documentation(visibility: private) -#endif - public func uniffiClonePointer() -> UnsafeMutableRawPointer { - return try! rustCall { uniffi_devolutions_crypto_uniffi_fn_clone_signingkeypair(self.pointer, $0) } - } - // No primary constructor declared for this class. - - deinit { - guard let pointer = pointer else { - return - } - - try! rustCall { uniffi_devolutions_crypto_uniffi_fn_free_signingkeypair(pointer, $0) } - } - - -public static func newFromBytes(data: Data)throws -> SigningKeyPair { - return try FfiConverterTypeSigningKeyPair_lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_constructor_signingkeypair_new_from_bytes( - FfiConverterData.lower(data),$0 - ) -}) -} - - - -open func getPrivateKey() -> Data { - return try! FfiConverterData.lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_method_signingkeypair_get_private_key(self.uniffiClonePointer(),$0 - ) -}) -} - -open func getPublicKey() -> Data { - return try! FfiConverterData.lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_method_signingkeypair_get_public_key(self.uniffiClonePointer(),$0 - ) -}) -} - - -} - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public struct FfiConverterTypeSigningKeyPair: FfiConverter { - - typealias FfiType = UnsafeMutableRawPointer - typealias SwiftType = SigningKeyPair - - public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> SigningKeyPair { - return SigningKeyPair(unsafeFromRawPointer: pointer) - } - - public static func lower(_ value: SigningKeyPair) -> UnsafeMutableRawPointer { - return value.uniffiClonePointer() - } - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SigningKeyPair { - let v: UInt64 = try readInt(&buf) - // The Rust code won't compile if a pointer won't fit in a UInt64. - // We have to go via `UInt` because that's the thing that's the size of a pointer. - let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if (ptr == nil) { - throw UniffiInternalError.unexpectedNullPointer - } - return try lift(ptr!) - } - - public static func write(_ value: SigningKeyPair, into buf: inout [UInt8]) { - // This fiddling is because `Int` is the thing that's the same size as a pointer. - // The Rust code won't compile if a pointer won't fit in a `UInt64`. - writeInt(&buf, UInt64(bitPattern: Int64(Int(bitPattern: lower(value))))) - } -} - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeSigningKeyPair_lift(_ pointer: UnsafeMutableRawPointer) throws -> SigningKeyPair { - return try FfiConverterTypeSigningKeyPair.lift(pointer) -} - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeSigningKeyPair_lower(_ value: SigningKeyPair) -> UnsafeMutableRawPointer { - return FfiConverterTypeSigningKeyPair.lower(value) -} - - - - -public struct KeyPair { - public var publicKey: Data - public var privateKey: Data - - // Default memberwise initializers are never public by default, so we - // declare one manually. - public init(publicKey: Data, privateKey: Data) { - self.publicKey = publicKey - self.privateKey = privateKey - } -} - -#if compiler(>=6) -extension KeyPair: Sendable {} -#endif - - -extension KeyPair: Equatable, Hashable { - public static func ==(lhs: KeyPair, rhs: KeyPair) -> Bool { - if lhs.publicKey != rhs.publicKey { - return false - } - if lhs.privateKey != rhs.privateKey { - return false - } - return true - } - - public func hash(into hasher: inout Hasher) { - hasher.combine(publicKey) - hasher.combine(privateKey) - } -} - - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public struct FfiConverterTypeKeyPair: FfiConverterRustBuffer { - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> KeyPair { - return - try KeyPair( - publicKey: FfiConverterData.read(from: &buf), - privateKey: FfiConverterData.read(from: &buf) - ) - } - - public static func write(_ value: KeyPair, into buf: inout [UInt8]) { - FfiConverterData.write(value.publicKey, into: &buf) - FfiConverterData.write(value.privateKey, into: &buf) - } -} - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeKeyPair_lift(_ buf: RustBuffer) throws -> KeyPair { - return try FfiConverterTypeKeyPair.lift(buf) -} - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeKeyPair_lower(_ value: KeyPair) -> RustBuffer { - return FfiConverterTypeKeyPair.lower(value) -} - -// Note that we don't yet support `indirect` for enums. -// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. - -public enum Argon2Variant { - - case argon2d - case argon2i - case argon2id -} - - -#if compiler(>=6) -extension Argon2Variant: Sendable {} -#endif - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public struct FfiConverterTypeArgon2Variant: FfiConverterRustBuffer { - typealias SwiftType = Argon2Variant - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Argon2Variant { - let variant: Int32 = try readInt(&buf) - switch variant { - - case 1: return .argon2d - - case 2: return .argon2i - - case 3: return .argon2id - - default: throw UniffiInternalError.unexpectedEnumCase - } - } - - public static func write(_ value: Argon2Variant, into buf: inout [UInt8]) { - switch value { - - - case .argon2d: - writeInt(&buf, Int32(1)) - - - case .argon2i: - writeInt(&buf, Int32(2)) - - - case .argon2id: - writeInt(&buf, Int32(3)) - - } - } -} - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeArgon2Variant_lift(_ buf: RustBuffer) throws -> Argon2Variant { - return try FfiConverterTypeArgon2Variant.lift(buf) -} - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeArgon2Variant_lower(_ value: Argon2Variant) -> RustBuffer { - return FfiConverterTypeArgon2Variant.lower(value) -} - - -extension Argon2Variant: Equatable, Hashable {} - - - -// Note that we don't yet support `indirect` for enums. -// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. - -public enum Argon2Version { - - case version10 - case version13 -} - - -#if compiler(>=6) -extension Argon2Version: Sendable {} -#endif - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public struct FfiConverterTypeArgon2Version: FfiConverterRustBuffer { - typealias SwiftType = Argon2Version - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Argon2Version { - let variant: Int32 = try readInt(&buf) - switch variant { - - case 1: return .version10 - - case 2: return .version13 - - default: throw UniffiInternalError.unexpectedEnumCase - } - } - - public static func write(_ value: Argon2Version, into buf: inout [UInt8]) { - switch value { - - - case .version10: - writeInt(&buf, Int32(1)) - - - case .version13: - writeInt(&buf, Int32(2)) - - } - } -} - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeArgon2Version_lift(_ buf: RustBuffer) throws -> Argon2Version { - return try FfiConverterTypeArgon2Version.lift(buf) -} - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeArgon2Version_lower(_ value: Argon2Version) -> RustBuffer { - return FfiConverterTypeArgon2Version.lower(value) -} - - -extension Argon2Version: Equatable, Hashable {} - - - -// Note that we don't yet support `indirect` for enums. -// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. - -public enum CiphertextVersion { - - case latest - case v1 - case v2 -} - - -#if compiler(>=6) -extension CiphertextVersion: Sendable {} -#endif - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public struct FfiConverterTypeCiphertextVersion: FfiConverterRustBuffer { - typealias SwiftType = CiphertextVersion - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CiphertextVersion { - let variant: Int32 = try readInt(&buf) - switch variant { - - case 1: return .latest - - case 2: return .v1 - - case 3: return .v2 - - default: throw UniffiInternalError.unexpectedEnumCase - } - } - - public static func write(_ value: CiphertextVersion, into buf: inout [UInt8]) { - switch value { - - - case .latest: - writeInt(&buf, Int32(1)) - - - case .v1: - writeInt(&buf, Int32(2)) - - - case .v2: - writeInt(&buf, Int32(3)) - - } - } -} - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeCiphertextVersion_lift(_ buf: RustBuffer) throws -> CiphertextVersion { - return try FfiConverterTypeCiphertextVersion.lift(buf) -} - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeCiphertextVersion_lower(_ value: CiphertextVersion) -> RustBuffer { - return FfiConverterTypeCiphertextVersion.lower(value) -} - - -extension CiphertextVersion: Equatable, Hashable {} - - - -// Note that we don't yet support `indirect` for enums. -// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. - -public enum DataType { - - case none - case key - case ciphertext - case passwordHash - case share - case signingKey - case signature - case onlineCiphertext -} - - -#if compiler(>=6) -extension DataType: Sendable {} -#endif - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public struct FfiConverterTypeDataType: FfiConverterRustBuffer { - typealias SwiftType = DataType - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> DataType { - let variant: Int32 = try readInt(&buf) - switch variant { - - case 1: return .none - - case 2: return .key - - case 3: return .ciphertext - - case 4: return .passwordHash - - case 5: return .share - - case 6: return .signingKey - - case 7: return .signature - - case 8: return .onlineCiphertext - - default: throw UniffiInternalError.unexpectedEnumCase - } - } - - public static func write(_ value: DataType, into buf: inout [UInt8]) { - switch value { - - - case .none: - writeInt(&buf, Int32(1)) - - - case .key: - writeInt(&buf, Int32(2)) - - - case .ciphertext: - writeInt(&buf, Int32(3)) - - - case .passwordHash: - writeInt(&buf, Int32(4)) - - - case .share: - writeInt(&buf, Int32(5)) - - - case .signingKey: - writeInt(&buf, Int32(6)) - - - case .signature: - writeInt(&buf, Int32(7)) - - - case .onlineCiphertext: - writeInt(&buf, Int32(8)) - - } - } -} - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeDataType_lift(_ buf: RustBuffer) throws -> DataType { - return try FfiConverterTypeDataType.lift(buf) -} - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeDataType_lower(_ value: DataType) -> RustBuffer { - return FfiConverterTypeDataType.lower(value) -} - - -extension DataType: Equatable, Hashable {} - - - - -public enum DevolutionsCryptoError: Swift.Error { - - - - case InvalidLength(message: String) - - case InvalidKeyLength(message: String) - - case InvalidOutputLength(message: String) - - case InvalidSignature(message: String) - - case InvalidMac(message: String) - - case InvalidDataType(message: String) - - case UnknownType(message: String) - - case UnknownSubtype(message: String) - - case UnknownVersion(message: String) - - case InvalidData(message: String) - - case NullPointer(message: String) - - case CryptoError(message: String) - - case RandomError(message: String) - - case IoError(message: String) - - case NotEnoughShares(message: String) - - case InconsistentVersion(message: String) - - case InvalidChunkLength(message: String) - - case PoisonedMutex(message: String) - -} - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public struct FfiConverterTypeDevolutionsCryptoError: FfiConverterRustBuffer { - typealias SwiftType = DevolutionsCryptoError - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> DevolutionsCryptoError { - let variant: Int32 = try readInt(&buf) - switch variant { - - - - - case 1: return .InvalidLength( - message: try FfiConverterString.read(from: &buf) - ) - - case 2: return .InvalidKeyLength( - message: try FfiConverterString.read(from: &buf) - ) - - case 3: return .InvalidOutputLength( - message: try FfiConverterString.read(from: &buf) - ) - - case 4: return .InvalidSignature( - message: try FfiConverterString.read(from: &buf) - ) - - case 5: return .InvalidMac( - message: try FfiConverterString.read(from: &buf) - ) - - case 6: return .InvalidDataType( - message: try FfiConverterString.read(from: &buf) - ) - - case 7: return .UnknownType( - message: try FfiConverterString.read(from: &buf) - ) - - case 8: return .UnknownSubtype( - message: try FfiConverterString.read(from: &buf) - ) - - case 9: return .UnknownVersion( - message: try FfiConverterString.read(from: &buf) - ) - - case 10: return .InvalidData( - message: try FfiConverterString.read(from: &buf) - ) - - case 11: return .NullPointer( - message: try FfiConverterString.read(from: &buf) - ) - - case 12: return .CryptoError( - message: try FfiConverterString.read(from: &buf) - ) - - case 13: return .RandomError( - message: try FfiConverterString.read(from: &buf) - ) - - case 14: return .IoError( - message: try FfiConverterString.read(from: &buf) - ) - - case 15: return .NotEnoughShares( - message: try FfiConverterString.read(from: &buf) - ) - - case 16: return .InconsistentVersion( - message: try FfiConverterString.read(from: &buf) - ) - - case 17: return .InvalidChunkLength( - message: try FfiConverterString.read(from: &buf) - ) - - case 18: return .PoisonedMutex( - message: try FfiConverterString.read(from: &buf) - ) - - - default: throw UniffiInternalError.unexpectedEnumCase - } - } - - public static func write(_ value: DevolutionsCryptoError, into buf: inout [UInt8]) { - switch value { - - - - - case .InvalidLength(_ /* message is ignored*/): - writeInt(&buf, Int32(1)) - case .InvalidKeyLength(_ /* message is ignored*/): - writeInt(&buf, Int32(2)) - case .InvalidOutputLength(_ /* message is ignored*/): - writeInt(&buf, Int32(3)) - case .InvalidSignature(_ /* message is ignored*/): - writeInt(&buf, Int32(4)) - case .InvalidMac(_ /* message is ignored*/): - writeInt(&buf, Int32(5)) - case .InvalidDataType(_ /* message is ignored*/): - writeInt(&buf, Int32(6)) - case .UnknownType(_ /* message is ignored*/): - writeInt(&buf, Int32(7)) - case .UnknownSubtype(_ /* message is ignored*/): - writeInt(&buf, Int32(8)) - case .UnknownVersion(_ /* message is ignored*/): - writeInt(&buf, Int32(9)) - case .InvalidData(_ /* message is ignored*/): - writeInt(&buf, Int32(10)) - case .NullPointer(_ /* message is ignored*/): - writeInt(&buf, Int32(11)) - case .CryptoError(_ /* message is ignored*/): - writeInt(&buf, Int32(12)) - case .RandomError(_ /* message is ignored*/): - writeInt(&buf, Int32(13)) - case .IoError(_ /* message is ignored*/): - writeInt(&buf, Int32(14)) - case .NotEnoughShares(_ /* message is ignored*/): - writeInt(&buf, Int32(15)) - case .InconsistentVersion(_ /* message is ignored*/): - writeInt(&buf, Int32(16)) - case .InvalidChunkLength(_ /* message is ignored*/): - writeInt(&buf, Int32(17)) - case .PoisonedMutex(_ /* message is ignored*/): - writeInt(&buf, Int32(18)) - - - } - } -} - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeDevolutionsCryptoError_lift(_ buf: RustBuffer) throws -> DevolutionsCryptoError { - return try FfiConverterTypeDevolutionsCryptoError.lift(buf) -} - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeDevolutionsCryptoError_lower(_ value: DevolutionsCryptoError) -> RustBuffer { - return FfiConverterTypeDevolutionsCryptoError.lower(value) -} - - -extension DevolutionsCryptoError: Equatable, Hashable {} - - - -extension DevolutionsCryptoError: Foundation.LocalizedError { - public var errorDescription: String? { - String(reflecting: self) - } -} - - -// Note that we don't yet support `indirect` for enums. -// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. - -public enum KeyVersion { - - case latest - case v1 -} - - -#if compiler(>=6) -extension KeyVersion: Sendable {} -#endif - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public struct FfiConverterTypeKeyVersion: FfiConverterRustBuffer { - typealias SwiftType = KeyVersion - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> KeyVersion { - let variant: Int32 = try readInt(&buf) - switch variant { - - case 1: return .latest - - case 2: return .v1 - - default: throw UniffiInternalError.unexpectedEnumCase - } - } - - public static func write(_ value: KeyVersion, into buf: inout [UInt8]) { - switch value { - - - case .latest: - writeInt(&buf, Int32(1)) - - - case .v1: - writeInt(&buf, Int32(2)) - - } - } -} - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeKeyVersion_lift(_ buf: RustBuffer) throws -> KeyVersion { - return try FfiConverterTypeKeyVersion.lift(buf) -} - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeKeyVersion_lower(_ value: KeyVersion) -> RustBuffer { - return FfiConverterTypeKeyVersion.lower(value) -} - - -extension KeyVersion: Equatable, Hashable {} - - - -// Note that we don't yet support `indirect` for enums. -// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. - -public enum PasswordHashVersion { - - case latest - case v1 -} - - -#if compiler(>=6) -extension PasswordHashVersion: Sendable {} -#endif - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public struct FfiConverterTypePasswordHashVersion: FfiConverterRustBuffer { - typealias SwiftType = PasswordHashVersion - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PasswordHashVersion { - let variant: Int32 = try readInt(&buf) - switch variant { - - case 1: return .latest - - case 2: return .v1 - - default: throw UniffiInternalError.unexpectedEnumCase - } - } - - public static func write(_ value: PasswordHashVersion, into buf: inout [UInt8]) { - switch value { - - - case .latest: - writeInt(&buf, Int32(1)) - - - case .v1: - writeInt(&buf, Int32(2)) - - } - } -} - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypePasswordHashVersion_lift(_ buf: RustBuffer) throws -> PasswordHashVersion { - return try FfiConverterTypePasswordHashVersion.lift(buf) -} - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypePasswordHashVersion_lower(_ value: PasswordHashVersion) -> RustBuffer { - return FfiConverterTypePasswordHashVersion.lower(value) -} - - -extension PasswordHashVersion: Equatable, Hashable {} - - - -// Note that we don't yet support `indirect` for enums. -// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. - -public enum SecretSharingVersion { - - case latest - case v1 -} - - -#if compiler(>=6) -extension SecretSharingVersion: Sendable {} -#endif - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public struct FfiConverterTypeSecretSharingVersion: FfiConverterRustBuffer { - typealias SwiftType = SecretSharingVersion - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SecretSharingVersion { - let variant: Int32 = try readInt(&buf) - switch variant { - - case 1: return .latest - - case 2: return .v1 - - default: throw UniffiInternalError.unexpectedEnumCase - } - } - - public static func write(_ value: SecretSharingVersion, into buf: inout [UInt8]) { - switch value { - - - case .latest: - writeInt(&buf, Int32(1)) - - - case .v1: - writeInt(&buf, Int32(2)) - - } - } -} - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeSecretSharingVersion_lift(_ buf: RustBuffer) throws -> SecretSharingVersion { - return try FfiConverterTypeSecretSharingVersion.lift(buf) -} - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeSecretSharingVersion_lower(_ value: SecretSharingVersion) -> RustBuffer { - return FfiConverterTypeSecretSharingVersion.lower(value) -} - - -extension SecretSharingVersion: Equatable, Hashable {} - - - -// Note that we don't yet support `indirect` for enums. -// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. - -public enum SignatureVersion { - - case latest - case v1 -} - - -#if compiler(>=6) -extension SignatureVersion: Sendable {} -#endif - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public struct FfiConverterTypeSignatureVersion: FfiConverterRustBuffer { - typealias SwiftType = SignatureVersion - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SignatureVersion { - let variant: Int32 = try readInt(&buf) - switch variant { - - case 1: return .latest - - case 2: return .v1 - - default: throw UniffiInternalError.unexpectedEnumCase - } - } - - public static func write(_ value: SignatureVersion, into buf: inout [UInt8]) { - switch value { - - - case .latest: - writeInt(&buf, Int32(1)) - - - case .v1: - writeInt(&buf, Int32(2)) - - } - } -} - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeSignatureVersion_lift(_ buf: RustBuffer) throws -> SignatureVersion { - return try FfiConverterTypeSignatureVersion.lift(buf) -} - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeSignatureVersion_lower(_ value: SignatureVersion) -> RustBuffer { - return FfiConverterTypeSignatureVersion.lower(value) -} - - -extension SignatureVersion: Equatable, Hashable {} - - - -// Note that we don't yet support `indirect` for enums. -// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. - -public enum SigningKeyVersion { - - case latest - case v1 -} - - -#if compiler(>=6) -extension SigningKeyVersion: Sendable {} -#endif - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public struct FfiConverterTypeSigningKeyVersion: FfiConverterRustBuffer { - typealias SwiftType = SigningKeyVersion - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SigningKeyVersion { - let variant: Int32 = try readInt(&buf) - switch variant { - - case 1: return .latest - - case 2: return .v1 - - default: throw UniffiInternalError.unexpectedEnumCase - } - } - - public static func write(_ value: SigningKeyVersion, into buf: inout [UInt8]) { - switch value { - - - case .latest: - writeInt(&buf, Int32(1)) - - - case .v1: - writeInt(&buf, Int32(2)) - - } - } -} - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeSigningKeyVersion_lift(_ buf: RustBuffer) throws -> SigningKeyVersion { - return try FfiConverterTypeSigningKeyVersion.lift(buf) -} - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -public func FfiConverterTypeSigningKeyVersion_lower(_ value: SigningKeyVersion) -> RustBuffer { - return FfiConverterTypeSigningKeyVersion.lower(value) -} - - -extension SigningKeyVersion: Equatable, Hashable {} - - - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -fileprivate struct FfiConverterOptionData: FfiConverterRustBuffer { - typealias SwiftType = Data? - - public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - guard let value = value else { - writeInt(&buf, Int8(0)) - return - } - writeInt(&buf, Int8(1)) - FfiConverterData.write(value, into: &buf) - } - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { - switch try readInt(&buf) as Int8 { - case 0: return nil - case 1: return try FfiConverterData.read(from: &buf) - default: throw UniffiInternalError.unexpectedOptionalTag - } - } -} - -#if swift(>=5.8) -@_documentation(visibility: private) -#endif -fileprivate struct FfiConverterSequenceData: FfiConverterRustBuffer { - typealias SwiftType = [Data] - - public static func write(_ value: [Data], into buf: inout [UInt8]) { - let len = Int32(value.count) - writeInt(&buf, len) - for item in value { - FfiConverterData.write(item, into: &buf) - } - } - - public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [Data] { - let len: Int32 = try readInt(&buf) - var seq = [Data]() - seq.reserveCapacity(Int(len)) - for _ in 0 ..< len { - seq.append(try FfiConverterData.read(from: &buf)) - } - return seq - } -} -public func base64Decode(data: String)throws -> Data { - return try FfiConverterData.lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_func_base64_decode( - FfiConverterString.lower(data),$0 - ) -}) -} -public func base64DecodeUrl(data: String)throws -> Data { - return try FfiConverterData.lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_func_base64_decode_url( - FfiConverterString.lower(data),$0 - ) -}) -} -public func base64Encode(data: Data) -> String { - return try! FfiConverterString.lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_func_base64_encode( - FfiConverterData.lower(data),$0 - ) -}) -} -public func base64EncodeUrl(data: Data) -> String { - return try! FfiConverterString.lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_func_base64_encode_url( - FfiConverterData.lower(data),$0 - ) -}) -} -public func decrypt(data: Data, key: Data)throws -> Data { - return try FfiConverterData.lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_func_decrypt( - FfiConverterData.lower(data), - FfiConverterData.lower(key),$0 - ) -}) -} -public func decryptAsymmetric(data: Data, key: Data)throws -> Data { - return try FfiConverterData.lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_func_decrypt_asymmetric( - FfiConverterData.lower(data), - FfiConverterData.lower(key),$0 - ) -}) -} -public func decryptAsymmetricWithAad(data: Data, key: Data, aad: Data)throws -> Data { - return try FfiConverterData.lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_func_decrypt_asymmetric_with_aad( - FfiConverterData.lower(data), - FfiConverterData.lower(key), - FfiConverterData.lower(aad),$0 - ) -}) -} -public func decryptWithAad(data: Data, key: Data, aad: Data)throws -> Data { - return try FfiConverterData.lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_func_decrypt_with_aad( - FfiConverterData.lower(data), - FfiConverterData.lower(key), - FfiConverterData.lower(aad),$0 - ) -}) -} -public func deriveKeyArgon2(key: Data, parameters: Argon2Parameters)throws -> Data { - return try FfiConverterData.lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_func_derive_key_argon2( - FfiConverterData.lower(key), - FfiConverterTypeArgon2Parameters_lower(parameters),$0 - ) -}) -} -public func deriveKeyPbkdf2(key: Data, salt: Data?, iterations: UInt32 = UInt32(10000), length: UInt32 = UInt32(32)) -> Data { - return try! FfiConverterData.lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_func_derive_key_pbkdf2( - FfiConverterData.lower(key), - FfiConverterOptionData.lower(salt), - FfiConverterUInt32.lower(iterations), - FfiConverterUInt32.lower(length),$0 - ) -}) -} -public func encrypt(data: Data, key: Data, version: CiphertextVersion = .latest)throws -> Data { - return try FfiConverterData.lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_func_encrypt( - FfiConverterData.lower(data), - FfiConverterData.lower(key), - FfiConverterTypeCiphertextVersion_lower(version),$0 - ) -}) -} -public func encryptAsymmetric(data: Data, key: Data, version: CiphertextVersion = .latest)throws -> Data { - return try FfiConverterData.lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_func_encrypt_asymmetric( - FfiConverterData.lower(data), - FfiConverterData.lower(key), - FfiConverterTypeCiphertextVersion_lower(version),$0 - ) -}) -} -public func encryptAsymmetricWithAad(data: Data, key: Data, aad: Data, version: CiphertextVersion = .latest)throws -> Data { - return try FfiConverterData.lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_func_encrypt_asymmetric_with_aad( - FfiConverterData.lower(data), - FfiConverterData.lower(key), - FfiConverterData.lower(aad), - FfiConverterTypeCiphertextVersion_lower(version),$0 - ) -}) -} -public func encryptWithAad(data: Data, key: Data, aad: Data, version: CiphertextVersion = .latest)throws -> Data { - return try FfiConverterData.lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_func_encrypt_with_aad( - FfiConverterData.lower(data), - FfiConverterData.lower(key), - FfiConverterData.lower(aad), - FfiConverterTypeCiphertextVersion_lower(version),$0 - ) -}) -} -public func generateKey(length: UInt32 = UInt32(32))throws -> Data { - return try FfiConverterData.lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_func_generate_key( - FfiConverterUInt32.lower(length),$0 - ) -}) -} -public func generateKeypair(version: KeyVersion = .latest) -> KeyPair { - return try! FfiConverterTypeKeyPair_lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_func_generate_keypair( - FfiConverterTypeKeyVersion_lower(version),$0 - ) -}) -} -public func generateSharedKey(nShares: UInt8, threshold: UInt8, length: UInt32 = UInt32(32), version: SecretSharingVersion = .latest)throws -> [Data] { - return try FfiConverterSequenceData.lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_func_generate_shared_key( - FfiConverterUInt8.lower(nShares), - FfiConverterUInt8.lower(threshold), - FfiConverterUInt32.lower(length), - FfiConverterTypeSecretSharingVersion_lower(version),$0 - ) -}) -} -public func generateSigningKeypair(version: SigningKeyVersion = .latest) -> SigningKeyPair { - return try! FfiConverterTypeSigningKeyPair_lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_func_generate_signing_keypair( - FfiConverterTypeSigningKeyVersion_lower(version),$0 - ) -}) -} -public func hashPassword(password: Data, iterations: UInt32 = UInt32(10000), version: PasswordHashVersion = .latest)throws -> Data { - return try FfiConverterData.lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_func_hash_password( - FfiConverterData.lower(password), - FfiConverterUInt32.lower(iterations), - FfiConverterTypePasswordHashVersion_lower(version),$0 - ) -}) -} -public func joinShares(shares: [Data])throws -> Data { - return try FfiConverterData.lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_func_join_shares( - FfiConverterSequenceData.lower(shares),$0 - ) -}) -} -public func mixKeyExchange(privateKey: Data, publicKey: Data)throws -> Data { - return try FfiConverterData.lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_func_mix_key_exchange( - FfiConverterData.lower(privateKey), - FfiConverterData.lower(publicKey),$0 - ) -}) -} -public func sign(data: Data, keypair: Data, version: SignatureVersion = .latest)throws -> Data { - return try FfiConverterData.lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_func_sign( - FfiConverterData.lower(data), - FfiConverterData.lower(keypair), - FfiConverterTypeSignatureVersion_lower(version),$0 - ) -}) -} -public func validateHeader(data: Data, dataType: DataType) -> Bool { - return try! FfiConverterBool.lift(try! rustCall() { - uniffi_devolutions_crypto_uniffi_fn_func_validate_header( - FfiConverterData.lower(data), - FfiConverterTypeDataType_lower(dataType),$0 - ) -}) -} -public func verifyPassword(password: Data, hash: Data)throws -> Bool { - return try FfiConverterBool.lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_func_verify_password( - FfiConverterData.lower(password), - FfiConverterData.lower(hash),$0 - ) -}) -} -public func verifySignature(data: Data, publicKey: Data, signature: Data)throws -> Bool { - return try FfiConverterBool.lift(try rustCallWithError(FfiConverterTypeDevolutionsCryptoError_lift) { - uniffi_devolutions_crypto_uniffi_fn_func_verify_signature( - FfiConverterData.lower(data), - FfiConverterData.lower(publicKey), - FfiConverterData.lower(signature),$0 - ) -}) -} - -private enum InitializationResult { - case ok - case contractVersionMismatch - case apiChecksumMismatch -} -// Use a global variable to perform the versioning checks. Swift ensures that -// the code inside is only computed once. -private let initializationResult: InitializationResult = { - // Get the bindings contract version from our ComponentInterface - let bindings_contract_version = 29 - // Get the scaffolding contract version by calling the into the dylib - let scaffolding_contract_version = ffi_devolutions_crypto_uniffi_uniffi_contract_version() - if bindings_contract_version != scaffolding_contract_version { - return InitializationResult.contractVersionMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_base64_decode() != 64610) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_base64_decode_url() != 15029) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_base64_encode() != 61134) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_base64_encode_url() != 31513) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_decrypt() != 41817) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_decrypt_asymmetric() != 47124) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_decrypt_asymmetric_with_aad() != 9987) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_decrypt_with_aad() != 59734) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_derive_key_argon2() != 60451) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_derive_key_pbkdf2() != 12853) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_encrypt() != 21235) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_encrypt_asymmetric() != 16258) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_encrypt_asymmetric_with_aad() != 34280) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_encrypt_with_aad() != 56466) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_generate_key() != 6364) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_generate_keypair() != 13437) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_generate_shared_key() != 9340) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_generate_signing_keypair() != 33572) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_hash_password() != 41934) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_join_shares() != 64867) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_mix_key_exchange() != 52615) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_sign() != 54825) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_validate_header() != 50316) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_verify_password() != 39819) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_func_verify_signature() != 35870) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_method_argon2parameters_get_bytes() != 51334) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_associated_data() != 20223) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_build() != 6812) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_dc_version() != 40712) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_iterations() != 28254) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_lanes() != 3637) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_length() != 791) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_memory() != 14913) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_salt() != 59352) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_secret_key() != 38451) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_variant() != 50137) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_version() != 39743) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_method_signingkeypair_get_private_key() != 10265) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_method_signingkeypair_get_public_key() != 47363) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_constructor_argon2parameters_new_from_bytes() != 3781) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_constructor_argon2parametersbuilder_new() != 19859) { - return InitializationResult.apiChecksumMismatch - } - if (uniffi_devolutions_crypto_uniffi_checksum_constructor_signingkeypair_new_from_bytes() != 17809) { - return InitializationResult.apiChecksumMismatch - } - - return InitializationResult.ok -}() - -// Make the ensure init function public so that other modules which have external type references to -// our types can call it. -public func uniffiEnsureDevolutionsCryptoUniffiInitialized() { - switch initializationResult { - case .ok: - break - case .contractVersionMismatch: - fatalError("UniFFI contract version mismatch: try cleaning and rebuilding your project") - case .apiChecksumMismatch: - fatalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } -} - -// swiftlint:enable all \ No newline at end of file diff --git a/wrappers/swift/DevolutionsCryptoSwift/Sources/devolutions_cryptoFFI/devolutions_cryptoFFI.h b/wrappers/swift/DevolutionsCryptoSwift/Sources/devolutions_cryptoFFI/devolutions_cryptoFFI.h deleted file mode 100644 index 53a69b897..000000000 --- a/wrappers/swift/DevolutionsCryptoSwift/Sources/devolutions_cryptoFFI/devolutions_cryptoFFI.h +++ /dev/null @@ -1,1033 +0,0 @@ -// This file was autogenerated by some hot garbage in the `uniffi` crate. -// Trust me, you don't want to mess with it! - -#pragma once - -#include -#include -#include - -// The following structs are used to implement the lowest level -// of the FFI, and thus useful to multiple uniffied crates. -// We ensure they are declared exactly once, with a header guard, UNIFFI_SHARED_H. -#ifdef UNIFFI_SHARED_H - // We also try to prevent mixing versions of shared uniffi header structs. - // If you add anything to the #else block, you must increment the version suffix in UNIFFI_SHARED_HEADER_V4 - #ifndef UNIFFI_SHARED_HEADER_V4 - #error Combining helper code from multiple versions of uniffi is not supported - #endif // ndef UNIFFI_SHARED_HEADER_V4 -#else -#define UNIFFI_SHARED_H -#define UNIFFI_SHARED_HEADER_V4 -// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ -// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ - -typedef struct RustBuffer -{ - uint64_t capacity; - uint64_t len; - uint8_t *_Nullable data; -} RustBuffer; - -typedef struct ForeignBytes -{ - int32_t len; - const uint8_t *_Nullable data; -} ForeignBytes; - -// Error definitions -typedef struct RustCallStatus { - int8_t code; - RustBuffer errorBuf; -} RustCallStatus; - -// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ -// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ -#endif // def UNIFFI_SHARED_H -#ifndef UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK -#define UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK -typedef void (*UniffiRustFutureContinuationCallback)(uint64_t, int8_t - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_FREE -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_FREE -typedef void (*UniffiForeignFutureFree)(uint64_t - ); - -#endif -#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE -#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE -typedef void (*UniffiCallbackInterfaceFree)(uint64_t - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE -#define UNIFFI_FFIDEF_FOREIGN_FUTURE -typedef struct UniffiForeignFuture { - uint64_t handle; - UniffiForeignFutureFree _Nonnull free; -} UniffiForeignFuture; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U8 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U8 -typedef struct UniffiForeignFutureStructU8 { - uint8_t returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureStructU8; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8 -typedef void (*UniffiForeignFutureCompleteU8)(uint64_t, UniffiForeignFutureStructU8 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I8 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I8 -typedef struct UniffiForeignFutureStructI8 { - int8_t returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureStructI8; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8 -typedef void (*UniffiForeignFutureCompleteI8)(uint64_t, UniffiForeignFutureStructI8 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U16 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U16 -typedef struct UniffiForeignFutureStructU16 { - uint16_t returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureStructU16; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16 -typedef void (*UniffiForeignFutureCompleteU16)(uint64_t, UniffiForeignFutureStructU16 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I16 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I16 -typedef struct UniffiForeignFutureStructI16 { - int16_t returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureStructI16; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16 -typedef void (*UniffiForeignFutureCompleteI16)(uint64_t, UniffiForeignFutureStructI16 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U32 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U32 -typedef struct UniffiForeignFutureStructU32 { - uint32_t returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureStructU32; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32 -typedef void (*UniffiForeignFutureCompleteU32)(uint64_t, UniffiForeignFutureStructU32 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I32 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I32 -typedef struct UniffiForeignFutureStructI32 { - int32_t returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureStructI32; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32 -typedef void (*UniffiForeignFutureCompleteI32)(uint64_t, UniffiForeignFutureStructI32 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U64 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_U64 -typedef struct UniffiForeignFutureStructU64 { - uint64_t returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureStructU64; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64 -typedef void (*UniffiForeignFutureCompleteU64)(uint64_t, UniffiForeignFutureStructU64 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I64 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_I64 -typedef struct UniffiForeignFutureStructI64 { - int64_t returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureStructI64; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64 -typedef void (*UniffiForeignFutureCompleteI64)(uint64_t, UniffiForeignFutureStructI64 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F32 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F32 -typedef struct UniffiForeignFutureStructF32 { - float returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureStructF32; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32 -typedef void (*UniffiForeignFutureCompleteF32)(uint64_t, UniffiForeignFutureStructF32 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F64 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_F64 -typedef struct UniffiForeignFutureStructF64 { - double returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureStructF64; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64 -typedef void (*UniffiForeignFutureCompleteF64)(uint64_t, UniffiForeignFutureStructF64 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_POINTER -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_POINTER -typedef struct UniffiForeignFutureStructPointer { - void*_Nonnull returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureStructPointer; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_POINTER -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_POINTER -typedef void (*UniffiForeignFutureCompletePointer)(uint64_t, UniffiForeignFutureStructPointer - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_RUST_BUFFER -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_RUST_BUFFER -typedef struct UniffiForeignFutureStructRustBuffer { - RustBuffer returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureStructRustBuffer; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER -typedef void (*UniffiForeignFutureCompleteRustBuffer)(uint64_t, UniffiForeignFutureStructRustBuffer - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_VOID -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_STRUCT_VOID -typedef struct UniffiForeignFutureStructVoid { - RustCallStatus callStatus; -} UniffiForeignFutureStructVoid; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID -typedef void (*UniffiForeignFutureCompleteVoid)(uint64_t, UniffiForeignFutureStructVoid - ); - -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_CLONE_ARGON2PARAMETERS -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_CLONE_ARGON2PARAMETERS -void*_Nonnull uniffi_devolutions_crypto_uniffi_fn_clone_argon2parameters(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FREE_ARGON2PARAMETERS -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FREE_ARGON2PARAMETERS -void uniffi_devolutions_crypto_uniffi_fn_free_argon2parameters(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_CONSTRUCTOR_ARGON2PARAMETERS_NEW_FROM_BYTES -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_CONSTRUCTOR_ARGON2PARAMETERS_NEW_FROM_BYTES -void*_Nonnull uniffi_devolutions_crypto_uniffi_fn_constructor_argon2parameters_new_from_bytes(RustBuffer data, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERS_GET_BYTES -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERS_GET_BYTES -RustBuffer uniffi_devolutions_crypto_uniffi_fn_method_argon2parameters_get_bytes(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_CLONE_ARGON2PARAMETERSBUILDER -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_CLONE_ARGON2PARAMETERSBUILDER -void*_Nonnull uniffi_devolutions_crypto_uniffi_fn_clone_argon2parametersbuilder(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FREE_ARGON2PARAMETERSBUILDER -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FREE_ARGON2PARAMETERSBUILDER -void uniffi_devolutions_crypto_uniffi_fn_free_argon2parametersbuilder(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_CONSTRUCTOR_ARGON2PARAMETERSBUILDER_NEW -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_CONSTRUCTOR_ARGON2PARAMETERSBUILDER_NEW -void*_Nonnull uniffi_devolutions_crypto_uniffi_fn_constructor_argon2parametersbuilder_new(RustCallStatus *_Nonnull out_status - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_ASSOCIATED_DATA -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_ASSOCIATED_DATA -void*_Nonnull uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_associated_data(void*_Nonnull ptr, RustBuffer value, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_BUILD -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_BUILD -void*_Nonnull uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_build(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_DC_VERSION -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_DC_VERSION -void*_Nonnull uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_dc_version(void*_Nonnull ptr, uint32_t value, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_ITERATIONS -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_ITERATIONS -void*_Nonnull uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_iterations(void*_Nonnull ptr, uint32_t value, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_LANES -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_LANES -void*_Nonnull uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_lanes(void*_Nonnull ptr, uint32_t value, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_LENGTH -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_LENGTH -void*_Nonnull uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_length(void*_Nonnull ptr, uint32_t value, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_MEMORY -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_MEMORY -void*_Nonnull uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_memory(void*_Nonnull ptr, uint32_t value, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_SALT -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_SALT -void*_Nonnull uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_salt(void*_Nonnull ptr, RustBuffer value, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_SECRET_KEY -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_SECRET_KEY -void*_Nonnull uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_secret_key(void*_Nonnull ptr, RustBuffer value, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_VARIANT -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_VARIANT -void*_Nonnull uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_variant(void*_Nonnull ptr, RustBuffer value, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_VERSION -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_ARGON2PARAMETERSBUILDER_VERSION -void*_Nonnull uniffi_devolutions_crypto_uniffi_fn_method_argon2parametersbuilder_version(void*_Nonnull ptr, RustBuffer value, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_CLONE_SIGNINGKEYPAIR -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_CLONE_SIGNINGKEYPAIR -void*_Nonnull uniffi_devolutions_crypto_uniffi_fn_clone_signingkeypair(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FREE_SIGNINGKEYPAIR -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FREE_SIGNINGKEYPAIR -void uniffi_devolutions_crypto_uniffi_fn_free_signingkeypair(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_CONSTRUCTOR_SIGNINGKEYPAIR_NEW_FROM_BYTES -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_CONSTRUCTOR_SIGNINGKEYPAIR_NEW_FROM_BYTES -void*_Nonnull uniffi_devolutions_crypto_uniffi_fn_constructor_signingkeypair_new_from_bytes(RustBuffer data, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_SIGNINGKEYPAIR_GET_PRIVATE_KEY -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_SIGNINGKEYPAIR_GET_PRIVATE_KEY -RustBuffer uniffi_devolutions_crypto_uniffi_fn_method_signingkeypair_get_private_key(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_SIGNINGKEYPAIR_GET_PUBLIC_KEY -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_METHOD_SIGNINGKEYPAIR_GET_PUBLIC_KEY -RustBuffer uniffi_devolutions_crypto_uniffi_fn_method_signingkeypair_get_public_key(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_BASE64_DECODE -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_BASE64_DECODE -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_base64_decode(RustBuffer data, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_BASE64_DECODE_URL -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_BASE64_DECODE_URL -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_base64_decode_url(RustBuffer data, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_BASE64_ENCODE -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_BASE64_ENCODE -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_base64_encode(RustBuffer data, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_BASE64_ENCODE_URL -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_BASE64_ENCODE_URL -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_base64_encode_url(RustBuffer data, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_DECRYPT -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_DECRYPT -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_decrypt(RustBuffer data, RustBuffer key, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_DECRYPT_ASYMMETRIC -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_DECRYPT_ASYMMETRIC -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_decrypt_asymmetric(RustBuffer data, RustBuffer key, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_DECRYPT_ASYMMETRIC_WITH_AAD -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_DECRYPT_ASYMMETRIC_WITH_AAD -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_decrypt_asymmetric_with_aad(RustBuffer data, RustBuffer key, RustBuffer aad, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_DECRYPT_WITH_AAD -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_DECRYPT_WITH_AAD -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_decrypt_with_aad(RustBuffer data, RustBuffer key, RustBuffer aad, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_DERIVE_KEY_ARGON2 -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_DERIVE_KEY_ARGON2 -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_derive_key_argon2(RustBuffer key, void*_Nonnull parameters, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_DERIVE_KEY_PBKDF2 -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_DERIVE_KEY_PBKDF2 -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_derive_key_pbkdf2(RustBuffer key, RustBuffer salt, uint32_t iterations, uint32_t length, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_ENCRYPT -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_ENCRYPT -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_encrypt(RustBuffer data, RustBuffer key, RustBuffer version, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_ENCRYPT_ASYMMETRIC -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_ENCRYPT_ASYMMETRIC -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_encrypt_asymmetric(RustBuffer data, RustBuffer key, RustBuffer version, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_ENCRYPT_ASYMMETRIC_WITH_AAD -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_ENCRYPT_ASYMMETRIC_WITH_AAD -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_encrypt_asymmetric_with_aad(RustBuffer data, RustBuffer key, RustBuffer aad, RustBuffer version, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_ENCRYPT_WITH_AAD -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_ENCRYPT_WITH_AAD -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_encrypt_with_aad(RustBuffer data, RustBuffer key, RustBuffer aad, RustBuffer version, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_GENERATE_KEY -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_GENERATE_KEY -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_generate_key(uint32_t length, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_GENERATE_KEYPAIR -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_GENERATE_KEYPAIR -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_generate_keypair(RustBuffer version, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_GENERATE_SHARED_KEY -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_GENERATE_SHARED_KEY -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_generate_shared_key(uint8_t n_shares, uint8_t threshold, uint32_t length, RustBuffer version, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_GENERATE_SIGNING_KEYPAIR -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_GENERATE_SIGNING_KEYPAIR -void*_Nonnull uniffi_devolutions_crypto_uniffi_fn_func_generate_signing_keypair(RustBuffer version, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_HASH_PASSWORD -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_HASH_PASSWORD -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_hash_password(RustBuffer password, uint32_t iterations, RustBuffer version, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_JOIN_SHARES -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_JOIN_SHARES -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_join_shares(RustBuffer shares, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_MIX_KEY_EXCHANGE -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_MIX_KEY_EXCHANGE -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_mix_key_exchange(RustBuffer private_key, RustBuffer public_key, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_SIGN -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_SIGN -RustBuffer uniffi_devolutions_crypto_uniffi_fn_func_sign(RustBuffer data, RustBuffer keypair, RustBuffer version, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_VALIDATE_HEADER -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_VALIDATE_HEADER -int8_t uniffi_devolutions_crypto_uniffi_fn_func_validate_header(RustBuffer data, RustBuffer data_type, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_VERIFY_PASSWORD -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_VERIFY_PASSWORD -int8_t uniffi_devolutions_crypto_uniffi_fn_func_verify_password(RustBuffer password, RustBuffer hash, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_VERIFY_SIGNATURE -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_FN_FUNC_VERIFY_SIGNATURE -int8_t uniffi_devolutions_crypto_uniffi_fn_func_verify_signature(RustBuffer data, RustBuffer public_key, RustBuffer signature, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUSTBUFFER_ALLOC -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUSTBUFFER_ALLOC -RustBuffer ffi_devolutions_crypto_uniffi_rustbuffer_alloc(uint64_t size, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUSTBUFFER_FROM_BYTES -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUSTBUFFER_FROM_BYTES -RustBuffer ffi_devolutions_crypto_uniffi_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUSTBUFFER_FREE -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUSTBUFFER_FREE -void ffi_devolutions_crypto_uniffi_rustbuffer_free(RustBuffer buf, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUSTBUFFER_RESERVE -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUSTBUFFER_RESERVE -RustBuffer ffi_devolutions_crypto_uniffi_rustbuffer_reserve(RustBuffer buf, uint64_t additional, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_U8 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_U8 -void ffi_devolutions_crypto_uniffi_rust_future_poll_u8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_U8 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_U8 -void ffi_devolutions_crypto_uniffi_rust_future_cancel_u8(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_U8 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_U8 -void ffi_devolutions_crypto_uniffi_rust_future_free_u8(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_U8 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_U8 -uint8_t ffi_devolutions_crypto_uniffi_rust_future_complete_u8(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_I8 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_I8 -void ffi_devolutions_crypto_uniffi_rust_future_poll_i8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_I8 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_I8 -void ffi_devolutions_crypto_uniffi_rust_future_cancel_i8(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_I8 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_I8 -void ffi_devolutions_crypto_uniffi_rust_future_free_i8(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_I8 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_I8 -int8_t ffi_devolutions_crypto_uniffi_rust_future_complete_i8(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_U16 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_U16 -void ffi_devolutions_crypto_uniffi_rust_future_poll_u16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_U16 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_U16 -void ffi_devolutions_crypto_uniffi_rust_future_cancel_u16(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_U16 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_U16 -void ffi_devolutions_crypto_uniffi_rust_future_free_u16(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_U16 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_U16 -uint16_t ffi_devolutions_crypto_uniffi_rust_future_complete_u16(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_I16 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_I16 -void ffi_devolutions_crypto_uniffi_rust_future_poll_i16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_I16 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_I16 -void ffi_devolutions_crypto_uniffi_rust_future_cancel_i16(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_I16 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_I16 -void ffi_devolutions_crypto_uniffi_rust_future_free_i16(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_I16 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_I16 -int16_t ffi_devolutions_crypto_uniffi_rust_future_complete_i16(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_U32 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_U32 -void ffi_devolutions_crypto_uniffi_rust_future_poll_u32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_U32 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_U32 -void ffi_devolutions_crypto_uniffi_rust_future_cancel_u32(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_U32 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_U32 -void ffi_devolutions_crypto_uniffi_rust_future_free_u32(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_U32 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_U32 -uint32_t ffi_devolutions_crypto_uniffi_rust_future_complete_u32(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_I32 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_I32 -void ffi_devolutions_crypto_uniffi_rust_future_poll_i32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_I32 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_I32 -void ffi_devolutions_crypto_uniffi_rust_future_cancel_i32(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_I32 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_I32 -void ffi_devolutions_crypto_uniffi_rust_future_free_i32(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_I32 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_I32 -int32_t ffi_devolutions_crypto_uniffi_rust_future_complete_i32(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_U64 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_U64 -void ffi_devolutions_crypto_uniffi_rust_future_poll_u64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_U64 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_U64 -void ffi_devolutions_crypto_uniffi_rust_future_cancel_u64(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_U64 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_U64 -void ffi_devolutions_crypto_uniffi_rust_future_free_u64(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_U64 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_U64 -uint64_t ffi_devolutions_crypto_uniffi_rust_future_complete_u64(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_I64 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_I64 -void ffi_devolutions_crypto_uniffi_rust_future_poll_i64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_I64 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_I64 -void ffi_devolutions_crypto_uniffi_rust_future_cancel_i64(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_I64 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_I64 -void ffi_devolutions_crypto_uniffi_rust_future_free_i64(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_I64 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_I64 -int64_t ffi_devolutions_crypto_uniffi_rust_future_complete_i64(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_F32 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_F32 -void ffi_devolutions_crypto_uniffi_rust_future_poll_f32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_F32 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_F32 -void ffi_devolutions_crypto_uniffi_rust_future_cancel_f32(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_F32 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_F32 -void ffi_devolutions_crypto_uniffi_rust_future_free_f32(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_F32 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_F32 -float ffi_devolutions_crypto_uniffi_rust_future_complete_f32(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_F64 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_F64 -void ffi_devolutions_crypto_uniffi_rust_future_poll_f64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_F64 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_F64 -void ffi_devolutions_crypto_uniffi_rust_future_cancel_f64(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_F64 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_F64 -void ffi_devolutions_crypto_uniffi_rust_future_free_f64(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_F64 -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_F64 -double ffi_devolutions_crypto_uniffi_rust_future_complete_f64(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_POINTER -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_POINTER -void ffi_devolutions_crypto_uniffi_rust_future_poll_pointer(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_POINTER -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_POINTER -void ffi_devolutions_crypto_uniffi_rust_future_cancel_pointer(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_POINTER -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_POINTER -void ffi_devolutions_crypto_uniffi_rust_future_free_pointer(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_POINTER -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_POINTER -void*_Nonnull ffi_devolutions_crypto_uniffi_rust_future_complete_pointer(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_RUST_BUFFER -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_RUST_BUFFER -void ffi_devolutions_crypto_uniffi_rust_future_poll_rust_buffer(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_RUST_BUFFER -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_RUST_BUFFER -void ffi_devolutions_crypto_uniffi_rust_future_cancel_rust_buffer(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_RUST_BUFFER -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_RUST_BUFFER -void ffi_devolutions_crypto_uniffi_rust_future_free_rust_buffer(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_RUST_BUFFER -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_RUST_BUFFER -RustBuffer ffi_devolutions_crypto_uniffi_rust_future_complete_rust_buffer(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_VOID -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_POLL_VOID -void ffi_devolutions_crypto_uniffi_rust_future_poll_void(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_VOID -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_CANCEL_VOID -void ffi_devolutions_crypto_uniffi_rust_future_cancel_void(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_VOID -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_FREE_VOID -void ffi_devolutions_crypto_uniffi_rust_future_free_void(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_VOID -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_RUST_FUTURE_COMPLETE_VOID -void ffi_devolutions_crypto_uniffi_rust_future_complete_void(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_BASE64_DECODE -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_BASE64_DECODE -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_base64_decode(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_BASE64_DECODE_URL -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_BASE64_DECODE_URL -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_base64_decode_url(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_BASE64_ENCODE -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_BASE64_ENCODE -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_base64_encode(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_BASE64_ENCODE_URL -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_BASE64_ENCODE_URL -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_base64_encode_url(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_DECRYPT -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_DECRYPT -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_decrypt(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_DECRYPT_ASYMMETRIC -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_DECRYPT_ASYMMETRIC -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_decrypt_asymmetric(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_DECRYPT_ASYMMETRIC_WITH_AAD -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_DECRYPT_ASYMMETRIC_WITH_AAD -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_decrypt_asymmetric_with_aad(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_DECRYPT_WITH_AAD -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_DECRYPT_WITH_AAD -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_decrypt_with_aad(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_DERIVE_KEY_ARGON2 -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_DERIVE_KEY_ARGON2 -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_derive_key_argon2(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_DERIVE_KEY_PBKDF2 -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_DERIVE_KEY_PBKDF2 -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_derive_key_pbkdf2(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_ENCRYPT -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_ENCRYPT -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_encrypt(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_ENCRYPT_ASYMMETRIC -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_ENCRYPT_ASYMMETRIC -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_encrypt_asymmetric(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_ENCRYPT_ASYMMETRIC_WITH_AAD -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_ENCRYPT_ASYMMETRIC_WITH_AAD -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_encrypt_asymmetric_with_aad(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_ENCRYPT_WITH_AAD -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_ENCRYPT_WITH_AAD -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_encrypt_with_aad(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_GENERATE_KEY -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_GENERATE_KEY -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_generate_key(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_GENERATE_KEYPAIR -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_GENERATE_KEYPAIR -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_generate_keypair(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_GENERATE_SHARED_KEY -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_GENERATE_SHARED_KEY -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_generate_shared_key(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_GENERATE_SIGNING_KEYPAIR -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_GENERATE_SIGNING_KEYPAIR -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_generate_signing_keypair(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_HASH_PASSWORD -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_HASH_PASSWORD -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_hash_password(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_JOIN_SHARES -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_JOIN_SHARES -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_join_shares(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_MIX_KEY_EXCHANGE -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_MIX_KEY_EXCHANGE -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_mix_key_exchange(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_SIGN -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_SIGN -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_sign(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_VALIDATE_HEADER -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_VALIDATE_HEADER -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_validate_header(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_VERIFY_PASSWORD -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_VERIFY_PASSWORD -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_verify_password(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_VERIFY_SIGNATURE -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_FUNC_VERIFY_SIGNATURE -uint16_t uniffi_devolutions_crypto_uniffi_checksum_func_verify_signature(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERS_GET_BYTES -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERS_GET_BYTES -uint16_t uniffi_devolutions_crypto_uniffi_checksum_method_argon2parameters_get_bytes(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_ASSOCIATED_DATA -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_ASSOCIATED_DATA -uint16_t uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_associated_data(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_BUILD -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_BUILD -uint16_t uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_build(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_DC_VERSION -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_DC_VERSION -uint16_t uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_dc_version(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_ITERATIONS -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_ITERATIONS -uint16_t uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_iterations(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_LANES -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_LANES -uint16_t uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_lanes(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_LENGTH -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_LENGTH -uint16_t uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_length(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_MEMORY -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_MEMORY -uint16_t uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_memory(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_SALT -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_SALT -uint16_t uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_salt(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_SECRET_KEY -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_SECRET_KEY -uint16_t uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_secret_key(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_VARIANT -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_VARIANT -uint16_t uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_variant(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_VERSION -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_ARGON2PARAMETERSBUILDER_VERSION -uint16_t uniffi_devolutions_crypto_uniffi_checksum_method_argon2parametersbuilder_version(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_SIGNINGKEYPAIR_GET_PRIVATE_KEY -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_SIGNINGKEYPAIR_GET_PRIVATE_KEY -uint16_t uniffi_devolutions_crypto_uniffi_checksum_method_signingkeypair_get_private_key(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_SIGNINGKEYPAIR_GET_PUBLIC_KEY -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_METHOD_SIGNINGKEYPAIR_GET_PUBLIC_KEY -uint16_t uniffi_devolutions_crypto_uniffi_checksum_method_signingkeypair_get_public_key(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_CONSTRUCTOR_ARGON2PARAMETERS_NEW_FROM_BYTES -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_CONSTRUCTOR_ARGON2PARAMETERS_NEW_FROM_BYTES -uint16_t uniffi_devolutions_crypto_uniffi_checksum_constructor_argon2parameters_new_from_bytes(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_CONSTRUCTOR_ARGON2PARAMETERSBUILDER_NEW -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_CONSTRUCTOR_ARGON2PARAMETERSBUILDER_NEW -uint16_t uniffi_devolutions_crypto_uniffi_checksum_constructor_argon2parametersbuilder_new(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_CONSTRUCTOR_SIGNINGKEYPAIR_NEW_FROM_BYTES -#define UNIFFI_FFIDEF_UNIFFI_DEVOLUTIONS_CRYPTO_UNIFFI_CHECKSUM_CONSTRUCTOR_SIGNINGKEYPAIR_NEW_FROM_BYTES -uint16_t uniffi_devolutions_crypto_uniffi_checksum_constructor_signingkeypair_new_from_bytes(void - -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_UNIFFI_CONTRACT_VERSION -#define UNIFFI_FFIDEF_FFI_DEVOLUTIONS_CRYPTO_UNIFFI_UNIFFI_CONTRACT_VERSION -uint32_t ffi_devolutions_crypto_uniffi_uniffi_contract_version(void - -); -#endif -