===================================================== CCC Rust Milestone 2 — Session State (Planning) ===================================================== :Status: Not started :Date: 2026-02-26 :Repository target: ``ccc_cryptography`` (plugin repo) :Depends on: ``ccc_rust`` Milestone 1 complete Related Documents ================= * Milestone 1 completion record: ``docs/ccc_rust_milestone1.rst`` Overview ======== This document tracks Milestone 2 execution state for Flutter plugin + bridge work. Milestone 2 begins with Milestone 1 already verified and complete. Current Gate Preconditions ========================== * ``[x]`` Milestone 1 verification gate passed. * ``[x]`` Conformance vectors passed in Rust workspace. * ``[x]`` Rust target builds validated (iOS + Android). Milestone 2 Work Checklist ========================== Phase 1 — Repository + Scaffold ------------------------------- * ``[ ]`` Create/confirm ``ccc_cryptography`` repository and branch strategy. * ``[ ]`` Create Flutter plugin scaffold (``pubspec.yaml``, ``ios/``, ``android/``, ``macos/``). * ``[ ]`` Add Rust bridge crate with ``crate-type = ["cdylib", "staticlib"]``. * ``[ ]`` Wire dependency on ``ccc_rust`` pinned tag/revision. Phase 2 — Bridge API Surface ---------------------------- * ``[ ]`` Define DTOs: * ``CapabilitiesDto`` * ``KemKeyPairDto`` * ``KemEncapDto`` * ``SelfTestDto`` * ``AlgoTestResultDto`` * ``[ ]`` Implement bridge entry points: * ``ccc_init`` * ``ccc_list_providers`` * ``ccc_capabilities`` / ``ccc_available_algorithms`` * ``ccc_aead_encrypt`` / ``ccc_aead_decrypt`` * ``ccc_kdf_derive`` * ``ccc_mac_compute`` / ``ccc_mac_verify`` * ``ccc_hash`` * ``ccc_kem_generate_keypair`` * ``ccc_kem_encapsulate`` / ``ccc_kem_decapsulate`` * ``ccc_self_test`` Phase 3 — FRB Codegen + Build Integration ----------------------------------------- * ``[ ]`` Add ``flutter_rust_bridge`` configuration + codegen scripts. * ``[ ]`` Run FRB codegen and commit generated artifacts. * ``[ ]`` Verify plugin compiles for iOS. * ``[ ]`` Verify plugin compiles for Android. * ``[ ]`` Verify plugin compiles for macOS. Phase 4 — Dart API Layer ------------------------ * ``[ ]`` Implement ``CccCrypto`` service API wrapper. * ``[ ]`` Implement ``CccSelfTest`` wrapper. * ``[ ]`` Implement runtime ``CccProviderCatalog`` population. * ``[ ]`` Ensure algorithm ID mapping remains 1:1 with Rust discriminants. Phase 5 — Integration + Validation ---------------------------------- * ``[ ]`` Add integration tests for AEAD roundtrip (at least AES-GCM and ChaCha20). * ``[ ]`` Add integration tests for KEM keygen/encap/decap flow. * ``[ ]`` Add integration tests for self-test API. * ``[ ]`` Run on iOS simulator. * ``[ ]`` Run on Android emulator/device. Milestone 2 TODO Queue ====================== Immediate TODOs (next session) ------------------------------ * ``[ ]`` Decide exact Milestone 2 repository location/URL and baseline branch. * ``[ ]`` Pin ``ccc_rust`` dependency to a reproducible reference (tag or commit hash). * ``[ ]`` Define FRB module layout and generated file commit policy. * ``[ ]`` Draft DTO type mapping table (Rust type -> bridge DTO -> Dart model). Backlog TODOs ------------- * ``[ ]`` Add CI job matrix for iOS/macOS/Android plugin builds. * ``[ ]`` Add versioning/release policy for plugin package. * ``[ ]`` Add troubleshooting notes for NDK/Xcode toolchains. Milestone 2 Verification Gate ============================= All of the following must pass before declaring Milestone 2 complete: * ``[ ]`` FRB bridge API compiles and loads in Flutter plugin. * ``[ ]`` Generated Dart bindings are committed and reproducible. * ``[ ]`` ``flutter build ios`` succeeds. * ``[ ]`` ``flutter build apk`` succeeds. * ``[ ]`` ``flutter build macos`` succeeds. * ``[ ]`` Integration test suite passes on iOS simulator. * ``[ ]`` Integration test suite passes on Android emulator/device. * ``[ ]`` Plugin package is tagged/released at ``v0.1.0`` (or agreed target version). Notes ===== * Milestone 2 is the first place where ``flutter_rust_bridge`` is allowed. * Milestone 1 Rust workspace remains bridge-free and should not be modified for Dart/plugin scaffolding.