Some checks failed
Podman Rootless Demo / test-backend (push) Has been skipped
Podman Rootless Demo / test-frontend (push) Has been skipped
Podman Rootless Demo / build-backend (push) Has been skipped
Podman Rootless Demo / build-frontend (push) Failing after 5m32s
Podman Rootless Demo / deploy-prod (push) Has been skipped
32 lines
No EOL
1.1 KiB
Rust
32 lines
No EOL
1.1 KiB
Rust
//! Unified cryptographic API with target-specific implementations
|
|
|
|
// Check for mutually exclusive override features
|
|
#[cfg(all(feature = "force-wasm", feature = "force-native"))]
|
|
compile_error!("Features 'force-wasm' and 'force-native' are mutually exclusive");
|
|
|
|
// Shared helper functions and types
|
|
mod shared;
|
|
|
|
// Platform-specific implementations
|
|
#[cfg(all(not(target_arch = "wasm32"), not(feature = "force-wasm")))]
|
|
mod native;
|
|
|
|
#[cfg(any(target_arch = "wasm32", feature = "force-wasm"))]
|
|
mod wasm;
|
|
|
|
// Re-export the unified API
|
|
#[cfg(all(not(target_arch = "wasm32"), not(feature = "force-wasm")))]
|
|
pub use native::{Bip39MnemonicGenerator, Ed25519KeyDeriver, XChaCha20FileEncryptor};
|
|
|
|
#[cfg(any(target_arch = "wasm32", feature = "force-wasm"))]
|
|
pub use wasm::{Bip39MnemonicGenerator, Ed25519KeyDeriver, XChaCha20FileEncryptor};
|
|
|
|
// Target-specific tests
|
|
#[cfg(all(test, all(not(target_arch = "wasm32"), not(feature = "force-wasm"))))]
|
|
mod native_test;
|
|
|
|
#[cfg(all(test, any(target_arch = "wasm32", feature = "force-wasm")))]
|
|
mod wasm_test;
|
|
|
|
// Re-export shared types if any
|
|
pub use shared::*; |