Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / library / e2ee-openpgp / AGENTS.md
| 1 | # AGENTS.md — library/e2ee-openpgp/ (':library:e2ee-openpgp') |
| 2 | |
| 3 | > Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `library/e2ee-openpgp/` + allowed shared modules. Do not root-scan. |
| 4 | |
| 5 | <!-- last-reviewed: 2026-11-05 --> |
| 6 | - Gradle: :library:e2ee-openpgp / dir: library/e2ee-openpgp/ |
| 7 | - Package roots present: (OpenPGP primitives — `com.vayunmathur.e2ee` package, shared with `:library:e2ee-p2p` by design so the JNI entry points stay stable) |
| 8 | - Entry files: Pgp.kt (no MainActivity/Route — library) |
| 9 | - Deps: (none — Rust rPGP core via JNI) |
| 10 | - Metadata: metadata_data/library-e2ee-openpgp.md (absent — libraries have none by design) |
| 11 | - Rust: yes / screenshotTest: no |
| 12 | |
| 13 | ## Overview |
| 14 | **Purpose:** OpenPGP (RFC 9580, Ed25519 primary + X25519 subkey) for SecureMail, backed by native Rust (rPGP) instead of BouncyCastle. Split out of `:library:e2ee-p2p`'s `e2ee_pqc` crate (#873): rPGP's cipher suite materially grows the `.so`, and only `:securemail` uses the PGP surface — every other e2ee-p2p consumer (office, cast, findfamily, everysync, backup, voxels, ...) links PQC only. |
| 15 | **How to use:** `Pgp.generateIdentity` / `encrypt` / `decrypt` / `decryptVerify` / `signDetached` (`Pgp.kt`); JNI via `PgpNative` (`libe2ee_pgp.so`). Keys cross as ASCII armor; the relay wire carries raw PGP bytes. |
| 16 | **Entry points:** `Pgp.kt` → `PgpNative.kt` (Rust bridge, `pgp_jni.rs`). |
| 17 | **Gotchas:** Crypto changes need adversarial review. Same `com.vayunmathur.e2ee` package as `:library:e2ee-p2p` is intentional (JNI names); keep it so. Phone-app only: arm64-v8a alone, no armeabi-v7a (unlike e2ee-p2p, which `:cast:tv` needs on 32-bit Google TV hardware). |
| 18 | |
| 19 | ## Key files |
| 20 | - com/vayunmathur/e2ee/Pgp.kt |
| 21 | - com/vayunmathur/e2ee/PgpNative.kt — Rust bridge (`// PACKAGE STRUCTURE EXCEPTION (JNI)`) |
| 22 | |
| 23 | ## Verify (this module only) |
| 24 | ``` |
| 25 | ./gradlew :library:e2ee-openpgp:compileDevKotlin |
| 26 | ./gradlew :library:e2ee-openpgp:lint |
| 27 | ``` |