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
//! Encrypted memo primitives for private transactions with ChaCha20Poly1305 AEAD
//!
//! ## Features
//!
//! - **Encryption**: Per-note key derivation from viewing key + commitment
//! - **Disclosure**: Selective disclosure proof structures (Groth16)
//! - **Key Derivation**: SHA-256 based with domain separation
//!
//! ## Architecture
//!
//! Clean Architecture — domain layer only, no FRAME dependencies:
//! - **value_objects**: Immutable keys and constants
//! - **entities**: `MemoData` entity + `MemoError`
//! - **ports**: Abstract interfaces (`MemoEncryptor`, `KeyDeriver`)
//! - **aggregates**: `KeySet`, disclosure structures
//! - **services**: Concrete implementations of the ports
//!
//! ## Example
//!
//! ```rust,ignore
//! use fp_encrypted_memo::{MemoData, KeySet, encrypt_memo, decrypt_memo};
//!
//! let keys = KeySet::from_spending_key(spending_key);
//! let memo = MemoData::new(1000, owner_pk, blinding, 0);
//! let encrypted = encrypt_memo(&memo, &commitment, keys.viewing_key.as_bytes(), &nonce)?;
//! let decrypted = decrypt_memo(&encrypted, &commitment, keys.viewing_key.as_bytes())?;
//! ```
extern crate alloc;
// ============================================================================
// Modules
// ============================================================================
// Domain layer - pure business logic
// ============================================================================
// Public API
// ============================================================================
// Constants
pub use ;
// Value objects (keys)
pub use ;
// Core entity and error
pub use ;
// Key set aggregate
pub use KeySet;
// Disclosure aggregates
pub use ;
// Ports (abstract interfaces)
pub use ;
// Encryption services
pub use ;
pub use encrypt_memo_random;
// Key derivation services
pub use ;