Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
translate ▾

Modern-Apps.git / library / e2ee-openpgp / AGENTS.md

AGENTS.md1.8 KiBRenderedCodeRaw
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- Gradle: :library:e2ee-openpgp / dir: library/e2ee-openpgp/
6- Package roots present: (OpenPGP primitives — `com.vayunmathur.e2ee` package, shared with `:library:e2ee-p2p` by design so the JNI entry points stay stable)
7- Entry files: Pgp.kt (no MainActivity/Route — library)
8- Deps: (none — Rust rPGP core via JNI)
9- Metadata: metadata_data/library-e2ee-openpgp.md (absent — libraries have none by design)
10- Rust: yes / screenshotTest: no
11
12## Overview
13**Purpose:** OpenPGP (RFC 9580, Ed25519 primary + X25519 subkey) for SecureMail, backed by native Rust (rPGP) instead of BouncyCastle. Only `:securemail` uses the PGP surface — every other e2ee-p2p consumer (office, cast, findfamily, everysync, backup, voxels, ...) links PQC only, and rPGP's cipher suite materially grows the `.so`.
14**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.
15**Entry points:** `Pgp.kt` → `PgpNative.kt` (Rust bridge, `pgp_jni.rs`).
16**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).
17
18## Key files
19- com/vayunmathur/e2ee/Pgp.kt
20- com/vayunmathur/e2ee/PgpNative.kt — Rust bridge (`// PACKAGE STRUCTURE EXCEPTION (JNI)`)
21
22## Verify (this module only)
23```
24./gradlew :library:e2ee-openpgp:compileDevKotlin
25./gradlew :library:e2ee-openpgp:lint
26```