1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
//! # AmateRS Core - Fully Homomorphic Encrypted Database Engine
//!
//! **amaters-core** is the kernel of the AmateRS distributed database,
//! providing Encryption-in-Use capabilities via TFHE (Fully Homomorphic Encryption).
//!
//! ## Core Principles
//!
//! - **Encryption in Use**: All data remains encrypted during computation
//! - **Zero Trust**: Servers never see plaintext data
//! - **Deterministic**: Reproducible results with cryptographic proofs
//! - **High Performance**: GPU-accelerated FHE operations
//!
//! ## Architecture
//!
//! AmateRS consists of four core components inspired by Japanese mythology:
//!
//! | Component | Origin | Role |
//! |-----------|--------|------|
//! | **Iwato** (岩戸) | Heavenly Rock Cave | Storage Engine |
//! | **Yata** (八咫鏡) | Eight-Span Mirror | Compute Engine |
//! | **Ukehi** (宇気比) | Sacred Pledge | Consensus Layer |
//! | **Musubi** (結び) | The Knot | Network Layer |
//!
//! ## Modules
//!
//! - [`error`] - Comprehensive error types and recovery strategies
//! - [`types`] - Core types (CipherBlob, Key, Query)
//! - [`traits`] - Storage engine trait definitions
//! - [`storage`] - Iwato storage engine (LSM-Tree with WiscKey)
//! - [`compute`] - Yata FHE execution engine
//! - [`validation`] - Input validation helpers
//!
//! ## Quick Start
//!
//! ```rust,ignore
//! use amaters_core::{
//! storage::MemoryStorage,
//! traits::StorageEngine,
//! types::{CipherBlob, Key},
//! };
//!
//! #[tokio::main]
//! async fn main() -> anyhow::Result<()> {
//! let storage = MemoryStorage::new();
//!
//! let key = Key::from_str("secret_data");
//! let encrypted = CipherBlob::new(vec![/* encrypted bytes */]);
//!
//! storage.put(&key, &encrypted).await?;
//! let retrieved = storage.get(&key).await?;
//!
//! Ok(())
//! }
//! ```
//!
//! ## Feature Flags
//!
//! - `storage` - Enable storage engine (Iwato)
//! - `compute` - Enable FHE compute engine (Yata)
//! - `parallel` - Enable parallel operations with Rayon
//! - `mmap` - Enable memory-mapped storage
//! - `gpu` - Enable GPU acceleration
//! - `cuda` - Enable CUDA backend (requires `gpu`)
//! - `metal` - Enable Metal backend (requires `gpu`)
//!
//! ## Security Model
//!
//! See the [technical whitepaper](../AmateRS--Tech-EN.md) for details on:
//! - Threat model and countermeasures
//! - Post-quantum security guarantees
//! - Key management best practices
//!
//! ## Development Status
//!
//! **Phase 1 (MVP):** Basic storage and compute stubs ✅
//! **Phase 2:** Full LSM-Tree and FHE integration 🚧
//! **Phase 3:** Distributed consensus and GPU acceleration 📋
// Re-exports for convenience
pub use ;
pub use CoreMetrics;
pub use StorageEngine;
pub use ;
/// Library version
pub const VERSION: &str = env!;
/// Library name
pub const NAME: &str = env!;